日期:2014-05-17  浏览次数:20636 次

SQL查询时出现“将字符串转换为 uniqueidentifier 时失败”。
select a.CustomerName,a.boy,b.girl from 
                            (select c.CustomerName,count(*) as boy from tb_masEmPersonalInfo a 
                            left join tb_masEmployeeEmployer b on a.EmPersonalInfoID=b.EmPersonalInfoID
                            left join tb_masCustomer c on b.CustomerID=c.CustomerID
                            where a.Disabled=0
                            and b.EwStatus in ('A','N') 
                            and a.GenderID=1
                            and c.CustomerID='@c.CustomerID'
                            group by c.CustomerName) a 
                            left join
                            (select c.CustomerName,count(*) as girl from tb_masEmPersonalInfo a 
                            left join tb_masEmployeeEmployer b on a.EmPersonalInfoID=b.EmPersonalInfoID
                            left join tb_masCustomer c on b.CustomerID=c.CustomerID
                            where a.Disabled=0