回复 8# istop2000 Select
(select sum(CKITEM_TOTAL)from JJ_PS_PGC_WHS_CKRESULT where PROJECT_ID='02000000000121' and to_char(CK_DATE,'yyyy')='2014' and to_char(CK_DATE,'mm')='05') as m_t1ckitemTotal ,
(select sum(CKITEM_PASS)from JJ_PS_PGC_WHS_CKRESULT where PROJECT_ID='02000000000121' and to_char(CK_DATE,'yyyy')=[i]'2014' and to_char(CK_DATE,'mm')='05') as m_t1ckitemPass ,
(select sum(CKITEM_TOTAL)from JJ_PS_PGC_WHS_CKRESULT where PROJECT_ID='02000000000121' and to_char(CK_DATE,'yyyy')=
'2014' and to_char(CK_DATE,'mm')<='05' and to_char(CK_DATE,'mm')>='01' ) as y_t1ckitemTotal,
(select sum(CKITEM_PASS)from JJ_PS_PGC_WHS_CKRESULT where PROJECT_ID='02000000000121' and to_char(CK_DATE,'yyyy')=
'2014' and to_char(CK_DATE,'mm')<='05' and to_char(CK_DATE,'mm')>='01' ) as y_t1ckitemPass
From
JJ_PS_PGC_WHS_CKRESULT
支持这种写法的吗?
[/i]