W
www.ynxbs.com
Unregistered / Unconfirmed
GUEST, unregistred user!
Accessselect = 'select 年龄组,性别,count(*) as 受检人数,' +<br> 'sum(IIf(低体重+消瘦+发育迟缓+严重营养不良=0,1,0)) as 正常数,' +<br> 'sum(IIf(低体重+严重营养不良=2,0,低体重) ) AS 低体重数,' +<br> 'sum(消瘦 ) AS 消瘦数,' +<br> 'sum(发育迟缓 ) AS 发育迟缓数,' +<br> 'sum(严重营养不良 ) AS 严重营养不良数,' +<br> 'sum(体重大于XSZ2 ) AS 体重大于XSZ2数,' +<br> 'sum(体重大于XS) AS 体重大于XS数,' +<br> 'sum(体重小于XSf2 ) AS 体重小于XSf2数,' +<br> 'sum(身高大于XSZ2 ) AS 身高大于XSZ2数,' +<br> 'sum(身高大于XS) AS 身高大于XS数,' +<br> 'sum(身高小于XSf2 ) AS 身高小于XSf2数 '+<br> ' from tj_record group by 年龄组,性别';<br><br> sqlserverselect = 'select 年龄组,性别,count(*) as 受检人数,' +<br> 'sum(case when 低体重+消瘦+发育迟缓+严重营养不良=0 then 1 else 0 end ) as 正常数,' +<br> 'sum(case when 低体重+严重营养不良=2 then 0 else 低体重 end ) AS 低体重数,' +<br> 'sum(消瘦 ) AS 消瘦数,' +<br> 'sum(发育迟缓 ) AS 发育迟缓数,' +<br> 'sum(严重营养不良 ) AS 严重营养不良数,' +<br> 'sum(体重大于XSZ2 ) AS 体重大于XSZ2数,' +<br> 'sum(体重大于XS) AS 体重大于XS数,' +<br> 'sum(体重小于XSf2 ) AS 体重小于XSf2数,' +<br> 'sum(身高大于XSZ2 ) AS 身高大于XSZ2数,' +<br> 'sum(身高大于XS) AS 身高大于XS数,' +<br> 'sum(身高小于XSf2 ) AS 身高小于XSf2数 '+<br> ' from tj_record group by 年龄组,性别';<br>这句sql 换做oracle 应该杂个写!????????