-
Originally Posted by jmodic
The result from the above query will not be sorted by logdate. It will be sorted by ID first, then by NAME and lastly by TDATE.
If you want to sort by LOGDATE, but do not LOGDATE to be includet into the resultset, then you should use:
Code:
select id, name, tdate
from
(select id, name, to_char(logdate, 'MON DD YYYY') tdate, logdate
from table1
union
select id, name, to_char(logdate, 'MON DD YYYY') tdate, logdate
from table2
)
order by logdate;
Welcome back to the forum..
funky...
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|