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

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

<?xml version="1.0" encoding="UTF-8"?>
<sql-cases>
    <sql-case id="assertSelectPaginationWithOffset" value="SELECT i.* 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 ORDER BY i.item_id DESC OFFSET %s" db-types="PostgreSQL" />
    <sql-case id="assertSelectPaginationWithRowCount" value="SELECT i.* 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 ORDER BY i.item_id DESC LIMIT %s" db-types="MySQL,H2,PostgreSQL" />
    <sql-case id="assertSelectPaginationWithTop" 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) AS row_" db-types="SQLServer" />
    <sql-case id="assertSelectPaginationWithRowNumber" 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 ORDER BY i.item_id DESC) row_ WHERE rownum &lt;= %s)" db-types="Oracle" />
    <sql-case id="assertSelectPaginationWithLimit" value="SELECT i.* 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 ORDER BY i.item_id DESC LIMIT %s, %s" db-types="MySQL,H2" />
    <sql-case id="assertSelectSingleTablePaginationWithLimit" value="SELECT o.* FROM `t_order` o ORDER BY o.order_id DESC LIMIT %s, %s" db-types="MySQL,H2" />
    <sql-case id="assertSelectPaginationWithOffsetAndLimit" value="SELECT i.* 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 ORDER BY i.item_id DESC OFFSET %s LIMIT %s" db-types="PostgreSQL" />
    <sql-case id="assertSelectPaginationWithTopAndRange" 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) AS row_ WHERE row_.rownum_ &gt; %s" db-types="SQLServer" />
    <sql-case id="assertSelectPaginationWithTopAndRangeWithEqual" 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) AS row_ WHERE row_.rownum_ &gt;= %s" db-types="SQLServer" />
    <sql-case id="assertSelectSingleTablePaginationWithTopAndRange" value="SELECT * FROM (SELECT TOP (%s) row_number() OVER (ORDER BY o.order_id DESC) AS rownum_, o.order_id as order_id, o.status as status, o.user_id as user_id FROM t_order o) AS row_ WHERE row_.rownum_ &gt; %s" db-types="SQLServer" />
    <sql-case id="assertSelectSingleTablePaginationWithTopAndRangeWithEqual" value="SELECT * FROM (SELECT TOP (%s) row_number() OVER (ORDER BY o.order_id DESC) AS rownum_, o.order_id as order_id, o.status as status, o.user_id as user_id FROM t_order o) AS row_ WHERE row_.rownum_ &gt;= %s" db-types="SQLServer" />
    <sql-case id="assertSelectPaginationWithRowNumberAndRange" 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 ORDER BY i.item_id DESC) row_ WHERE rownum &lt;= %s) t WHERE t.rownum_ &gt; %s" db-types="Oracle" />
    <sql-case id="assertSelectPaginationWithRowNumberAndRangeWithEqual" 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 ORDER BY i.item_id DESC) row_ WHERE rownum &lt;= %s) t WHERE t.rownum_ &gt;= %s" db-types="Oracle" />
    <sql-case id="assertSelectSingleTablePaginationWithRowNumberAndRange" value="SELECT * FROM (SELECT t.*, ROWNUM rownum_ FROM (SELECT * FROM t_order ORDER BY order_id DESC) t WHERE ROWNUM &lt; %s) row_ WHERE row_.rownum_ &gt; %s" db-types="Oracle" />
    <sql-case id="assertSelectSingleTablePaginationWithRowNumberAndRangeWithEqual" value="SELECT * FROM (SELECT t.*, ROWNUM rownum_ FROM (SELECT * FROM t_order ORDER BY order_id DESC) t WHERE t.order_id &lt;= %s AND ROWNUM &lt;= %s) row_ WHERE row_.rownum_ &gt;= %s" db-types="Oracle" />
    <sql-case id="assertSelectSingleTablePaginationWithRowNumberAndRangeWithEqualDiffOrder" value="SELECT * FROM (SELECT t.*, ROWNUM rownum_ FROM (SELECT * FROM t_order ORDER BY order_id DESC) t WHERE ROWNUM &lt;= %s AND t.order_id &lt;= %s) row_ WHERE row_.rownum_ &gt;= %s" db-types="Oracle" />
    <sql-case id="assertSelectLeftJoinAndLimit" value="SELECT i.* FROM t_order o LEFT JOIN t_order_item i ON o.order_id = i.order_id WHERE 1=1 AND o.user_id = %s AND o.order_id = %s ORDER BY i.item_id LIMIT %s, %s" db-types="H2,MySQL" />
</sql-cases>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy