【SQL Server】 两张相同字段的表拼接(Union)
SELECT date,name,code,times,times1 FROM (( SELECT t1.date, t1.NAME, t1.CODE, t1.times, t2.times1 FROM table1 t1 LEFT JOIN table2 t2 ON t1.CODE = t2.CODE UNION SELECT t2.date, t2.NAME, t2.CODE, t1.times, t2.times1 FROM table1 t1 RIGHT JOIN table2 t2 ON t1.CODE = t2.CODE WHERE t1.CODE IS NULL )) AS temp ORDER BY date
有志者,事竟成,破釜沉舟,百二秦关终属楚; 苦心人,天不负,卧薪尝胆,三千越甲可吞吴。