Jump to content

UNION + ORDER BY with different column names


Kokoro
 Share

Recommended Posts

Hi, I have this problem Suppose I have two tables with two columns each. I use a union to retrieve the info from both tables like this:SELECT Column1, Column2FROM Table1UNIONSELECT Column3, Column4FROM Table2Is there a way to sort the result by the first or second column without using the column number?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...