各位大哥们!!有问题请教!!!
SELECT distinct s.F_sbmc,
s.F_sbbh,
s.F_sbxh,
s.f_ks,
s.autoid,
count(s.f_sbmc ) as shuliang
FROM HOSPITAL_SBJBK as a left join hospital_sbwxb as b on a.autoid =b.autoid left
join hospital_sbhtjd as c on b.f_sbmc =c.f_sbmc left join hospital_sbxcb as d
on b.f_sbmc =d.f_sbmc s,
(select count( t.id ) as jiandu,t.F_sbmc from hospital_sbhtjd ,
hospital_sbwxht p where t.f_htid =p.f_htid and t.f_sbmc and
t.jdrq between '2005-11-01' and '2005-12-31' group by t.F_sbmc) f
where s.if_yn ='3' and s.wxrq between '2005-11-01' and '2005-12-31' and
s.F_SBMC=f.F_sbmc
group by
s.F_sbmc,
s.F_sbbh,
s.F_sbxh,
s.f_ks,
s.autoid
这是我写的SQL语句,可是运行总是提示错误,错误提示如下:
服务器: 消息 170,级别 15,状态 1,行 7
第 7 行: 's' 附近有语法错误。
服务器: 消息 170,级别 15,状态 1,行 10
第 10 行: 'f' 附近有语法错误。