All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sql.dql.select_pagination_group_by_order_by.xml Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<sql-cases>
    <sql-case id="assertSelectPaginationWithGroupByAndOrderBy" value="SELECT i.user_id FROM `t_order` o JOIN `t_order_item` i ON o.user_id = i.user_id AND o.order_id = i.order_id WHERE o.`user_id` IN (%s, %s) AND o.`order_id` BETWEEN %s AND %s GROUP BY i.item_id ORDER BY i.item_id DESC LIMIT %s, %s" db-types="MySQL,H2" />
    <sql-case id="assertSelectPaginationWithDiffGroupByAndOrderBy" value="SELECT i.user_id FROM `t_order` o JOIN `t_order_item` i ON o.user_id = i.user_id AND o.order_id = i.order_id WHERE o.`user_id` IN (%s, %s) AND o.`order_id` BETWEEN %s AND %s GROUP BY i.user_id ORDER BY i.item_id DESC LIMIT %s, %s" db-types="MySQL,H2" />
    <sql-case id="assertSelectPaginationWithTopAndGroupByAndOrderBy" value="SELECT * FROM (SELECT TOP %s row_number() OVER (ORDER BY i.item_id DESC) AS rownum_, i.item_id, o.order_id as order_id, o.status as status, o.user_id as user_id FROM t_order o JOIN t_order_item i ON o.user_id = i.user_id AND o.order_id = i.order_id WHERE o.user_id IN (%s, %s) AND o.order_id BETWEEN %s AND %s GROUP BY i.item_id) AS row_ WHERE row_.rownum_ &gt; %s" db-types="SQLServer" />
    <sql-case id="assertSelectPaginationWithTopAndGroupByAndOrderByAndParentheses" value="SELECT * FROM (SELECT TOP (%s) row_number() OVER (ORDER BY i.item_id DESC) AS rownum_, i.item_id, o.order_id as order_id, o.status as status, o.user_id as user_id FROM t_order o JOIN t_order_item i ON o.user_id = i.user_id AND o.order_id = i.order_id WHERE o.user_id IN (%s, %s) AND o.order_id BETWEEN %s AND %s GROUP BY i.item_id) AS row_ WHERE row_.rownum_ &gt; %s" db-types="SQLServer" />
    <sql-case id="assertSelectPaginationWithTopAndDiffGroupByAndOrderBy" value="SELECT * FROM (SELECT TOP %s row_number() OVER (ORDER BY i.item_id DESC) AS rownum_, i.item_id, o.order_id as order_id, o.status as status, o.user_id as user_id FROM t_order o JOIN t_order_item i ON o.user_id = i.user_id AND o.order_id = i.order_id WHERE o.user_id IN (%s, %s) AND o.order_id BETWEEN %s AND %s GROUP BY i.user_id ) AS row_ WHERE row_.rownum_ &gt; %s" db-types="SQLServer" />
    <sql-case id="assertSelectPaginationWithTopAndDiffGroupByAndOrderByAndParentheses" value="SELECT * FROM (SELECT TOP (%s) row_number() OVER (ORDER BY i.item_id DESC) AS rownum_, i.item_id, o.order_id as order_id, o.status as status, o.user_id as user_id FROM t_order o JOIN t_order_item i ON o.user_id = i.user_id AND o.order_id = i.order_id WHERE o.user_id IN (%s, %s) AND o.order_id BETWEEN %s AND %s GROUP BY i.user_id ) AS row_ WHERE row_.rownum_ &gt; %s" db-types="SQLServer" />
    <sql-case id="assertSelectPaginationWithRowNumberAndGroupByAndOrderBy" value="SELECT * FROM (SELECT row_.*, rownum rownum_ FROM (SELECT order0_.order_id as order_id, order0_.status as status, order0_.user_id as user_id FROM t_order order0_ JOIN t_order_item i ON order0_.user_id = i.user_id AND order0_.order_id = i.order_id WHERE order0_.user_id IN (%s, %s) AND order0_.order_id BETWEEN %s AND %s GROUP BY i.item_id ORDER BY i.item_id DESC) row_ WHERE rownum &lt;= %s) t WHERE t.rownum_ &gt; %s" db-types="Oracle" />
    <sql-case id="assertSelectPaginationWithRowNumberAndDiffGroupByAndOrderBy" value="SELECT * FROM (SELECT row_.*, rownum rownum_ FROM (SELECT order0_.order_id as order_id, order0_.status as status, order0_.user_id as user_id FROM t_order order0_ JOIN t_order_item i ON order0_.user_id = i.user_id AND order0_.order_id = i.order_id WHERE order0_.user_id IN (%s, %s) AND order0_.order_id BETWEEN %s AND %s GROUP BY i.user_id ORDER BY i.item_id DESC) row_ WHERE rownum &lt;= %s) t WHERE t.rownum_ &gt; %s" db-types="Oracle" />
</sql-cases>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy