-1
這是我的腳本。SQL Server 2008 R2分組
select jt.exempt_status as ExemptStatus, COUNT(*) as ExemptCount
from employee as e
join job_title as jt
on e.job_title = jt.job_title
group by jt.exempt_status
在執行時它顯示
ExemptStatus ExemptCount
-----------------------------
E 2
N 5
我需要它什麼顯示而無需在jt.exempt_status字段改變值是。
ExemptStatus ExemptCount
-----------------------------
Exempt 2
Non-Exempt 5
有包含exempt_status代碼的說明表? –
@Jeff - 爲了完整性,您使用的是什麼RDBMS? SQL Server? MySQL的? PostgreSQL的?還有別的嗎? – LittleBobbyTables