关于联合查询问题,急!!急!!急!!,在线等!
在联合查询的时候,出现了这样的情况:
sql语句:
select count(id) as shuliang from gzdt
union select count(id) as shuliang from jdgz
union select count(id) as shuliang from kycg_hjcg
union select count(id) as shuliang from kycg_kyxm
union select count(id) as shuliang from kycg_lwzz
union select count(id) as shuliang from kylt
union select count(id) as shuliang from lianjie
如果其中两个表中的记录相等或所有表中的记录都相等的话,结果集中把相等记录数只显示一条记录,这样我想动态统计每个表中记录的时候就出现了问题.
如:
所有表中的记录数都是一条,查询的结果只有一条记录: shuliang 为1
我想在结果中得到七条记录,该如何修改语句或有没有其他的办法?请各位高手指点一二.