新手问题。我想做类似的事情:
SELECT c1,c2,c3 FROM TABLE t1
UNION
SELECT c1,c2,c3 FROM TABLE t2 WHERE t1.c1 IS NOT NULL AND t1.c2 IS NULL;
所以如果我有 t1:
c1|c2|c3
1 | a|v1
2 | b|v2
和 t2:
c1|c2|c3
1 | a|v3
2 | b|v4
2 | c|v5
3 | d|v6
我会得到:
c1|c2|c3
1 | a|v1
2 | b|v2
2 | c|v5
有人知道该怎么做吗?