Skip to Main Content
  • Questions
  • Looking for SQL Query to get below output

Breadcrumb

XMAS_TREE

The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.

Question and Answer

Connor McDonald

Thanks for the question.

Asked: April 22, 2025 - 7:00 pm UTC

Last updated: April 23, 2025 - 8:06 am UTC

Version: Oracle 19C

Viewed 1000+ times

You Asked

Can someone please provide Oracle sql query to get below output?

Deptno Dept Name No. of emp
10 a 10
b 20
c 30
20 d 40
e 50
f 60
30 g 70
h 80
i 90

and Connor said...

Check out the KEEP clause



We're not taking comments currently, so please try again later if you want to add a comment.