I have table data like this
id id1 name 1 1 test1 1 1 test1 1 2 test2 2 1 test1 2 2 test2 3 1 test1 3 2 test2 3 2 test2
now from table i want the data as below like for id = 1 order by id1 asc the first name = test1 so i want the first two row
id id1 name 1 1 test1 1 1 test1
not third row
For id=2 order by id1 asc the first name = test1 so i want first row as test1 has assign only ones for id=2
id id1 name 2 1 test1
And for id=3 same as id=2
Please suggest me how can get the perticlur value for ID , because the scenerio is differnt for ID=1