<sqlid="assertSelectDateFuncWithGroupBy"value="SELECT date_format(c_date, '%%y-%%m-%%d') as c_date, count(*) as c_number FROM `t_order_item` WHERE order_id in (%s, %s) GROUP BY date_format(c_date, '%%y-%%m-%%d')"type="MySQL"/>
<sqlid="assertSelectSumWithGroupBy"value="SELECT SUM(order_id) AS orders_sum, user_id FROM t_order GROUP BY user_id"/>
<sqlid="assertSelectCountWithGroupBy"value="SELECT COUNT(order_id) AS orders_count, user_id FROM t_order GROUP BY user_id"/>
<sqlid="assertSelectMaxWithGroupBy"value="SELECT MAX(order_id) AS max_order_id, user_id FROM t_order GROUP BY user_id"/>
<sqlid="assertSelectMinWithGroupBy"value="SELECT MIN(order_id) AS min_order_id, user_id FROM t_order GROUP BY user_id"/>
<sqlid="assertSelectAvgWithGroupBy"value="SELECT AVG(order_id) AS orders_avg, user_id FROM t_order GROUP BY user_id"/>
<sqlid="assertSelectSumWithGroupBy"value="SELECT SUM(order_id) AS orders_sum, user_id FROM t_order GROUP BY user_id ORDER BY user_id"/>
<sqlid="assertSelectCountWithGroupBy"value="SELECT COUNT(order_id) AS orders_count, user_id FROM t_order GROUP BY user_id ORDER BY user_id"/>
<sqlid="assertSelectMaxWithGroupBy"value="SELECT MAX(order_id) AS max_order_id, user_id FROM t_order GROUP BY user_id ORDER BY user_id"/>
<sqlid="assertSelectMinWithGroupBy"value="SELECT MIN(order_id) AS min_order_id, user_id FROM t_order GROUP BY user_id ORDER BY user_id"/>
<sqlid="assertSelectAvgWithGroupBy"value="SELECT AVG(order_id) AS orders_avg, user_id FROM t_order GROUP BY user_id ORDER BY user_id"/>
<sqlid="assertSelectOrderByDescWithGroupBy"value="SELECT SUM(order_id) AS orders_sum, user_id FROM t_order GROUP BY user_id ORDER BY orders_sum DESC"/>
<sqlid="assertSelectCountWithoutGroupedColumn"value="SELECT count(*) as items_count 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 o.user_id"/>
<sqlid="assertSelectCountWithGroupByBindingTable"value="SELECT count(*) as items_count, o.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 o.user_id"/>
<sqlid="assertSelectCountWithGroupByBindingTable"value="SELECT count(*) as items_count, o.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 o.user_id ORDER BY o.user_id"/>
<sqlid="assertSelectWithGroupByAndLimit"value="SELECT user_id FROM t_order GROUP BY user_id LIMIT %s"type="H2,MySQL,PostgreSQL"/>
<sqlid="assertSelectWithGroupByAndOrderByAndLimit"value="SELECT user_id, SUM(order_id) FROM t_order GROUP BY user_id ORDER BY SUM(order_id) LIMIT %s"type="H2,MySQL,PostgreSQL"/>
<sqlid="assertSelectGroupByWithAliasIsKeyword"value="SELECT SUM(order_id) AS orders_sum, user_id as `key` FROM t_order GROUP BY `key`"type="MySQL"/>