我正在尝试运行以下查询:
SELECT
A.STEPNAME,
A.BRDATE BRDATE_A,
B.BRDATE BRDATE_B,
MIN(A.STARTTIME) STARTTIME_A,
MAX(A.ENDTIME) ENDTIME_A,
MIN(B.STARTTIME) STARTTIME_B,
MAX(B.ENDTIME) ENDTIME_B,
'RUNTIME_A' = convert(VARCHAR,DATEDIFF(MINUTE,A.STARTTIME,A.ENDTIME),108) ,
'RUNTIME_B' = convert(VARCHAR,DATEDIFF(MINUTE,B.STARTTIME,B.ENDTIME),108)
FROM
CB_OPX_AUDIT_HIST A,
CB_OPX_AUDIT_HIST B
WHERE
A.BRDATE = ('05/11/2012')
AND
B.BRDATE = ('05/16/2012')
AND
A.BR = '03'
AND
A.STEPNAME=B.STEPNAME
AND
A.BR=B.BR
GROUP BY
A.STEPNAME,
A.ENDTIME,
A.STARTTIME,
A.BRDATE,
B.BRDATE,
B.ENDTIME,
B.STARTTIME
ORDER BY
A.STARTTIME
我需要'RUNTIME_A'和'RUNTIME_B'之间的区别..
有人可以告诉我如何在上述查询中得到区别。?