Expecting a mytable
where x
can have the same value on multiple rows, but we only want to catch the first (or last) occurrence.
Target Qry:
select *
from my_table
where x IN ('A', 'B', 'C') <<some limit to get the first occurrence>>;
And an example mytable
(first row is column names):
x y
A 5
A 1
A 3
B 3
B 2
C 8
Target Response (first occurrence):
x y
A 5
B 3
C 8
Can this may be archived using sub-queries?