I'm newbie in Oracle and I am programming some stuff things but I need to do something that it's beyond me.
First of all, I have to use Oracle 8i
We start with a table with data similar to:
Column1 Column2
A 7
A 9
A 13
B 5
B 6
C 1
C 4
C 9
C 40
I need to take FIRST 2 values from this table for EACH letter (column1)
Value1 = n1 Value2 = n2
For example, for A values are 7 and 9 but for B are 5 and 6
Sorry, I can't draw a table (
And I don't know how many letter could have this table ofc, so I suppose the best way it's maybe a LOOP for all table, taking just first and second row (table is arranged and ALWAYS need first and second values for each letter) but I'm not sure how can I do...
Maybe a query filter by column1 and a rownum <3 ? I'm not sure if this query always take just first 2 values or take 2 aleatory values...