Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table like one shown below
T1 | T3 | T2 |
A | A | 0 |
A | B | 1 |
A | A | 2 |
B | B | 2 |
B | A | 1 |
B | B | 0 |
C | A | 1 |
C | B | 2 |
C | A | 3 |
D | B | 1 |
E | A | 1 |
E | B | 0 |
F | A | 1 |
F | B | 1 |
G | A | 2 |
I want to find first Row of T2 for each T1 as shown below. Please help.
T1 | T3 | T2 |
A | A | 0 |
B | B | 2 |
C | A | 1 |
D | B | 1 |
E | A | 1 |
E | B | 0 |
F | A | 1 |
G | A | 2 |
I tried using first sorted value but I was not able to write.
could someone please help me.
Thanks in advance.
Hi,
Check with the FirstValue and LastValue functionality to get first and last values.
Load
T1,
FirstValue(T3) AS T3,
FirstValue(T2) AS T2
Resident TableName
Group By T1;
Hope it helps