This content has been marked as final. Show 5 replies
Can you provide the source table format?
Are the city names in 2 separates columns?
I'm not sure how you would do this either. I messed with it a little bit without success. You should post the question in the SQL and PL/SQL - you'll have an answer before the day is out.
Edited by: MLBrown on Nov 6, 2012 10:37 AM
yes, the city names are the two columns (ORIGIN, DESTINATION)
Thanks mate, This really makes sense.
You can try this:
greatest(ORIGIN, DESTINATION) as "City a"
,least(ORIGIN, DESTINATION) as "City b"
But you have to be sure that columns ORIGIN, DESTINATION from MY_TABLE have "NOT NULL" contraints, otherwise you have to deal with null values somehow (e.g. with "nvl").