Is there a way to have something in your select clause, so that you can use it for order by clause , but not have it display? For example:
select acno,1 ordering from rcb_acct
where acno in ('555555666666666','333333333333333')
and lgon_pref = 'MYN'
select acno,2 ordering from rcb_acct
where lgon_pref = 'MYN'
order by ordering, acno
I don't want the ordering field returned. I just want it to put my results in the correct order.
However, there are soome issues with your query as posted. First, any records where acno in (your list) will show up twice. That is because the rows are different because of the ordering column, so they will not be combined in the UNION. If that is what you wanted, then okay. However, if you simply wanted them to be sorted first in the list, then try this: