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.
03-22-2001, 08:57 AM
In SQL*Plus, issue the command:
column ordering NOPRINT
Then run the query. (Use the same command, but with PRINT instead of NOPRINT to undo the effect).
03-22-2001, 11:00 AM
Assuming you want this somewhere other than SQL*PLUS :)
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: