Dear All,
Kindly advise a solution for receiving the following output using the PIVOT clause.
Created with reference to :
NB : Kindly take to consideration that the tables shown here are sample data tables. Real life table contains nearly 100 menus under the MENU table and thousands of users, each having access to various menus, under USERS table.
MENU
MENU_ID | MENU_NAME |
A | 1 |
B | 2 |
C | 3 |
D | 4 |
E | 5 |
F | 6 |
G | 7 |
H | 8 |
I | 9 |
J | 10 |
K | 11 |
L | 12 |
M | 13 |
N | 14 |
O | 15 |
P | 16 |
Q | 17 |
R | 18 |
S | 19 |
T | 20 |
U | 21 |
V | 22 |
W | 23 |
X | 24 |
Y | 25 |
Z | 26 |
USER1
USER_ID | USER_NAME | MENU_ID |
U1 | USER 1 | A |
U1 | USER 1 | F |
U2 | USER 2 | A |
U2 | USER 2 | F |
U3 | USER 3 | B |
U3 | USER 3 | G |
U4 | USER 4 | B |
U4 | USER 4 | G |
U5 | USER 5 | C |
U5 | USER 5 | H |
U6 | USER 6 | C |
U7 | USER 7 | D |
U8 | USER 8 | D |
U9 | USER 9 | E |
U10 | USER 10 | E |
OUTPUT