Dear all,
Kindly find below table records for sample data.
| TABLE-01 | ||
| Dept | Total No of codes | |
| A | 1191 | |
| B | 1039 | |
| C | 2012 | |
| D | 3780 | |
| E | 9 | |
| F | 5972 | |
| G | 2186 | |
| TABLE-02 | ||
| user | dept | |
| U1 | A | |
| U2 | A | |
| U3 | B | |
| U4 | C | |
| U5 | E | |
| U6 | G | |
| TABLE-03 | ||
| USER | VAL1 | date |
| U1 | 1001 | 06-10-2020 |
| U2 | 1002 | 06-10-2020 |
| U4 | 1004 | 06-10-2020 |
| U3 | 1003 | 07-10-2020 |
| U4 | 1005 | 07-10-2020 |
| U4 | 1004 | 07-10-2020 |
| U4 | 1006 | 08-10-2020 |
| U5 | 1005 | 08-10-2020 |
| U3 | 1003 | 09-10-2020 |
| U6 | 1006 | 09-10-2020 |
An I need result as below:
| Result | ||||||
| Dept | Total No of codes | Total CompletedCodes | 06-10-2020 | 07-10-2020 | 08-10-2020 | 09-10-2020 |
| A | 10 | 2 | 2 | 0 | 0 | 0 |
| B | 20 | 2 | 0 | 1 | 0 | 1 |
| C | 15 | 4 | 1 | 2 | 1 | 0 |
| D | 30 | 0 | 0 | 0 | 0 | 0 |
| E | 9 | 1 | 0 | 0 | 1 | 0 |
| F | 44 | 0 | 0 | 0 | 0 | 0 |
| G | 58 | 1 | 0 | 0 | 0 | 1 |
| total | 186 | 10 | 3 | 3 | 2 | 2 |
Please find below image for your ref.


Kiran MohantyRank #821 · 2.8K reputationPosted Oct 9, 2020, 2:17 AM EDT
Abhishek ChadhaRank #402 · 6.2K reputationPosted Oct 7, 2020, 1:17 AM EDT
Tamil Selvan119 reputationPosted Oct 8, 2020, 8:18 PM EDT
Abhishek ChadhaRank #402 · 6.2K reputationPosted Oct 8, 2020, 9:23 PM EDT
Tamil Selvan119 reputationPosted Oct 8, 2020, 10:20 PM EDT
Mageshwaran RRank #411 · 6.1K reputationPosted Oct 8, 2020, 11:00 PM EDT