How can I set a flag based on the returned row number from a select statement?
e.g.
Select Field1 from Table1 where ....
returns 20 records. I want to set a flag called 'SLA' to 'T' if it is one of the first ten records and 'F' it is not in the first ten so I would get something like:
'TEST1', 'T' - for the first ten
'TEST11', 'F' - if it's not in the first ten
I tried using the rownum function but I couldn't get it right (i may have been using the wrong syntax though).
Thanks
e.g.
Select Field1 from Table1 where ....
returns 20 records. I want to set a flag called 'SLA' to 'T' if it is one of the first ten records and 'F' it is not in the first ten so I would get something like:
'TEST1', 'T' - for the first ten
'TEST11', 'F' - if it's not in the first ten
I tried using the rownum function but I couldn't get it right (i may have been using the wrong syntax though).
Thanks