-1
我有2列工作和表emp中的部門。每個項目明智計數
job department ------------------------------------------- manager accounting president accounting manager accounting clerk accounting manager accounting manager accounting manager accounting clerk accounting analyst accounting security accounting security accounting clerk accounting analyst accounting security accounting
我有一個要求拉像下面
status status_numbers status status_numbers ------------------------------------------------------------------------------ Total 14 Total 14 manager 5 manager 5 president 1 president 1 clerk 3 clerk 3 analyst 2 analyst 2 security 3 security 3
這裏的地位和status_numbers列需要重複
非常感謝您................ – ravt
如何在上面的查詢中加入deptno以加入dept表? – ravt
@ravt只需將它添加到選擇+組。例如http://sqlfiddle.com/#!4/77780/1。如果在那裏顯示兩個選項,一個在部門+工作上有一個總計,另一個沒有,因爲你沒有說出你想要輸出的樣子。 – DazzaL