有没有办法可以结合这两个 MySQL 查询?它目前使排序和分页等变得非常困难。
SELECT *
FROM (`lb_sales`)
WHERE `recurring` = '0'
AND `created` >= '2012-10-01 00:00:00'
AND `created` <= '2012-10-30 23:59:59'
AND `status` = 'pending'
AND `type` = 'sale'
AND `account_id` = '2'
ORDER BY `id` ASC
LIMIT 5;
SELECT *
FROM (`lb_sales`)
WHERE `recurring` = '1'
AND `created` <= '2012-10-30 23:59:59'
AND `status` = 'pending'
AND `type` = 'sale'
AND `account_id` = '2'
ORDER BY `id` ASC
LIMIT 5;