我将如何编写一个不会使用 mysql 给我重复的查询?我的结果表不应包含重复项。
第一个查询是:
SELECT ord_no,name, mobile, address, rate, mrp,
create_date, edited_date,status
FROM orders o, customer c
where o.cust_id = c.id and status = 'CHECKED'
AND DATEDIFF(CURDATE(), edited_date) between 2 and 3
order by 1;
第二个查询是:
SELECT ord_no,name, mobile, address, rate, mrp,
create_date, edited_date,status
FROM orders o, customer c
where o.cust_id = c.id and status = 'CHECKED'
AND edited_date<DATE_SUB(now(),interval 48 hour)
order by 1;
我该如何过滤它?