I have got to select records from a table based on col B below it should have either 'AC' or 'TM' but if both 'AC' and 'TM' are present for same value in 'A' then it should select only the first record.
Mubeena... Did you get answer from above queries, of what you were looking for ?
Check it what I think on this...
SELECT * FROM (SELECT DISTINCT A, B FROM TABLE) WHERE B IN ('AC','TM');
Inner query should return the records with only first row among duplicates, outer query would filter out to keep only the one having "AC" or "TM".
I could not test it before posting, but a little variation of this concept should provide you the result- in case this doesnt work.