查詢申請組如何通過條款
SELECT
TIMECARD.EMP_ID, TIMECARD.TIMECARD_ID, TIMECARD.TIMECARD_STATUS,
TASK.MAN_HOURS
FROM
TRN_TIMECARD_ACTIVITY ACT
INNER JOIN
TRN_TIMECARD TIMECARD ON TIMECARD.TIMECARD_ID = ACT.TIMECARD_ID
INNER JOIN
TRN_TIMECARD_TASK TASK ON TASK.TIMECARD_ID = TIMECARD.TIMECARD_ID
WHERE
ACT.TIMECARD_STATUS IN ('AP','RE')
OUTPUT:
61 42 AP 9
61 42 AP 9
61 43 AP 9
61 43 AP 9
61 47 AP 7
我有emp_id
獲得組和計算sum(man_hours)
。
如何獲得像下面
61 42 AP 52
你怎麼' 52'? – 2013-02-19 12:40:27
爲什麼你分組後42? – 2013-02-19 12:40:34