2018 年 08 月 17 日 • 阅读: 2301 • mysql查询


SELECT,o.order_number,o.order_status,o.addtime,,op.product_id from nr_order o LEFT JOIN nr_order_product op ON o.main_id = op.product_id and = op.order_id where o.addtime > '2018-08-17 00:00:00' and product_id is null;


SELECT * FROM nr_order WHERE main_id='748398825' and befrom='native'

SELECT * FROM nr_order WHERE order_number='XM809040152078338';

SELECT date format(addtim,'%y-%m-%d'),max(id)-min(id)+1,count(*) FROM nr_order
WHERE addtime>'2018-09-01' GROUP BY DATE_FORMAT(addtime,'%y-%m-%d')

select order_number,orderid from nr_order_source  where order_number not in(select order_number from nr_order) limit 10;

select count(*),order_number,orderid from nr_order_source  where orderid not in(select id from nr_order) limit 5000;

SELECT * FROM `nr_order_source` where addtime like "%2018-09-04%" and server_source not in ("tt-cache: [gii2]cache3","tt-cache: [gii2]cache5")

兼总条贯 知至知终

最后编辑于: 2018 年 10 月 17 日