0

refernce data in db

emp_id date
1111 08-09-22
2222 08-09-22
3333 08-09-22
2222 08-09-22
3333 08-09-22
1111 09-09-22
3333 09-09-22
3333 09-09-22
2222 10-09-22
2222 10-09-22
2222 10-09-22

expected result

emp_id 08-09-22 09-09-22 10-09-22 total
1111 1 1 0 2
2222 2 0 3 5
3333 2 2 0 4
balaji
  • 1
  • 1
  • Try searching the Internet for [oracle sql pivot query](https://blogs.oracle.com/sql/post/how-to-convert-rows-to-columns-and-back-again-with-sql-aka-pivot-and-unpivot) – Abra Sep 08 '22 at 09:49
  • You want a pivot query. See https://stackoverflow.com/questions/4841718/oracle-sql-pivot-query for example – Serg Sep 08 '22 at 09:49
  • try the example queries ,and post what you have tried so far, do ask ' need a query?' – Sund'er Sep 08 '22 at 09:50
  • Pivot and then add the column values to give the total. – MT0 Sep 08 '22 at 09:54

0 Answers0