我的SQL是
select t.*,b.b4 from
(
select b.n1,b.n2.b.n3,count(a.n1) a4 from a,b, where a.id=b.id group by a.n1,a.n2.a.n3
) t
full join
(
select b.n1,b.n2.b.n3,count(a.n1) b4 from a,b, where a.id=b.id group by a.n1,a.n2.a.n3
) r
on t.n1=r.n1 and t.n2=r.n2 and t.n3=r.n3注:两个表名 a 是不相同的两张表
结果:
如当 别名 t表中无记录,而别名 r表中有一条记录时,取出二条记录,但字段值都是空的
是否那里有错??谢谢
select t.*,b.b4 from
(
select b.n1,b.n2.b.n3,count(a.n1) a4 from a,b, where a.id=b.id group by a.n1,a.n2.a.n3
) t
full join
(
select b.n1,b.n2.b.n3,count(a.n1) b4 from a,b, where a.id=b.id group by a.n1,a.n2.a.n3
) r
on t.n1=r.n1 and t.n2=r.n2 and t.n3=r.n3注:两个表名 a 是不相同的两张表
结果:
如当 别名 t表中无记录,而别名 r表中有一条记录时,取出二条记录,但字段值都是空的
是否那里有错??谢谢
(
select b.n1,b.n2.b.n3,count(a.n1) a4 from a,b, where a.id=b.id group by a.n1,a.n2.a.n3
) t
full join
(
select b.n1,b.n2.b.n3,count(a.n1) b4 from a,b, where a.id=b.id group by a.n1,a.n2.a.n3
) r
on t.n1=r.n1 and t.n2=r.n2 and t.n3=r.n3 看看。
from關鍵字后面多了個逗號