I need to show records in such a way that some selected records should appear in the first place. After that, other records are sorted from one table.
For example, if I select a state with a state of IDID = 5, then the corresponding record should be the first. after that, the other entries must arrive in a sorted manner.
For this, I tried to combine, but it shows everything in sorted order.
select state from statemaster where stateid=5 union all select state from statemaster where not stateid =5 order by state
thanks
source share