Mysql合并2表找出不同项

SELECT id, time24
FROM (
    SELECT t1.id,t1.time24, t1.time48, t1.time72, t1.time96, t1.timegt96, t1.total, t1.type, t1.platform
        FROM scs_delivery_time_line t1
        UNION ALL
        SELECT t2.id,t2.time24, t2.time48, t2.time72, t2.time96, t2.timegt96, t2.total, t2.type, t2.platform
        FROM scs_delivery_time_line_copy t2
) tbl
GROUP BY id, time24
HAVING count(*) = 1

 

posted @ 2018-09-18 10:41  浪味仙人  阅读(258)  评论(0编辑  收藏  举报