日期:2014-05-17 浏览次数:20575 次
CREATE TABLE t1 ( a varchar(2) PRIMARY KEY, B varchar(2), c varchar(2) ) INSERT INTO t1 VALUES('a1','b1','c1') CREATE TABLE t2 ( a varchar(2) , d varchar(2) PRIMARY KEY, e varchar(2) , f varchar(2) ) INSERT INTO t2 VALUES( 'a1','d1','e1','f1'),( 'a1','d2','e1','f1') SELECT DISTINCT t1.a,b,c,e,f FROM t1 LEFT JOIN t2 ON t1.a=t2.a
------解决方案--------------------