请大家看看我的语句有什么问题[未解决]?
select a.name,id_card,b.sname,sfzh,a.bknbcode_id,b.leibie into shuju from no07 a , zuihoujieguo bwhere a.name=b.sname
and len(b.sfzh)=15 and len(a.id_card)=15 and a.id_card=b.sfzh and a.bknbcode_id=b.leibie
union
select a.name,id_card,b.sname,sfzh,a.bknbcode_id,b.leibie from forums_ksbm a ,zuihoujieguo b
where a.name=b.sname
and left(b.sfzh,6)=left(a.id_card,6)
and len(b.sfzh)=15 and len(a.id_card)=18
and substring(a.id_card,9,6)=substring(b.sfzh,7,6) and a.bknbcode_id=b.leibie
union
select a.name,id_card,b.sname,sfzh,a.bknbcode_id,b.leibie from forums_ksbm a , zuihoujieguo b
where a.name=b.sname
and len(b.sfzh)=18 and len(a.id_card)=18 and a.id_card=b.sfzh and a.bknbcode_id=b.leibie
union
select a.name,id_card,b.sname,sfzh,a.bknbcode_id,b.leibie from forums_ksbm a , zuihoujieguo b
where a.name=b.sname
and left(b.sfzh,6)=left(a.id_card,6)
and len(a.id_card)=15 and len(b.sfzh)=18
and substring(b.sfzh,9,6)=substring(a.id_card,7,6) and a.bknbcode_id=b.leibie
这个语句中查出shuju中有749条记录
然后
select * from shuju a, no07 b where a.name=no07.name and a.id_card =b.id_card
查出的纪录条数是401条
怎么会有这种情况呢?
为什么不是749条呢?
谢谢 :)
[此贴子已经被作者于2007-5-14 17:12:28编辑过]