I have the following SQL statement:
SELECT ID, NAME FROM myTable
WHERE
ID LIKE 'R43%' OR
ID LIKE 'D32%' OR
ID LIKE 'F22%'
and ID might have values such as:
ID
____
R431
R431
R432
R434
D322
D322
D327
F226
F227
How would I only get the records for the first ID matched? Like for the values above, I would only get records for (R431, R431, D322, D322, F226). The ID values in the table I’m grabbing from are sequential (so R432’s will always appear after R431s in the table).
Use Oracle Analytical functions for these kind of queries