Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle SQL query - Grouping function to take 1st value for non-grouped cols
This query should do the Job:
SELECT
DEPARTMENT,
MIN(JOB) KEEP (DENSE_RANK FIRST ORDER BY ROWNUM) JOB, MIN(TOTAL_EMPL) KEEP (DENSE_RANK FIRST ORDER BY ROWNUM) TOTAL_EMPL, MIN(AVERAGE_SAL) KEEP (DENSE_RANK FIRST ORDER BY ROWNUM) AVERAGE_SALFROM AAAA