tuzojazz Posted March 31, 2006 Share Posted March 31, 2006 HiI have two tables: Employees_Norway and Employees_USAEmployees_Norway:Employee_ID E_Name-------------------------------01 Hansen, Ola 02 Svendson, Tove 03 Svendson, Stephen 04 Pettersen, Kari Employees_USA:Employee_ID E_Name------------------------------01 Turner, Sally 02 Kent, Clark 03 Svendson, Stephen 04 Scott, Stephen In order to list all employees in Norway and USA I'm using this query:------------------------------------------------SELECT E_Name FROM Employees_NorwayUNION ALLSELECT E_Name FROM Employees_USA------------------------------------------------I get this resultName ----------------------Hansen, Ola Svendson, Tove Svendson, Stephen Pettersen, Kari Turner, Sally Kent, Clark Svendson, Stephen Scott, Stephen What more does need my query to get the result in alphabetical order?Thanks!! Link to comment Share on other sites More sharing options...
Siddhesh Posted April 1, 2006 Share Posted April 1, 2006 In order to list all employees in Norway and USA I'm using this query:------------------------------------------------SELECT E_Name FROM Employees_NorwayUNION ALLSELECT E_Name FROM Employees_USA------------------------------------------------I get this resultName ----------------------Hansen, Ola Svendson, Tove Svendson, Stephen Pettersen, Kari Turner, Sally Kent, Clark Svendson, Stephen Scott, Stephen Thanks!!<{POST_SNAPBACK}> Try thisSelect *From (SELECT E_Name FROM Employees_Norway UNION ALL SELECT E_Name FROM Employees_USA) Table_AliasOrder By E_Name Link to comment Share on other sites More sharing options...
Guest raman Posted April 7, 2006 Share Posted April 7, 2006 HiI have two tables: Employees_Norway and Employees_USAEmployees_Norway:Employee_ID E_Name-------------------------------01 Hansen, Ola 02 Svendson, Tove 03 Svendson, Stephen 04 Pettersen, Kari Employees_USA:Employee_ID E_Name------------------------------01 Turner, Sally 02 Kent, Clark 03 Svendson, Stephen 04 Scott, Stephen In order to list all employees in Norway and USA I'm using this query:------------------------------------------------SELECT E_Name FROM Employees_NorwayUNION ALLSELECT E_Name FROM Employees_USA------------------------------------------------I get this resultName ----------------------Hansen, Ola Svendson, Tove Svendson, Stephen Pettersen, Kari Turner, Sally Kent, Clark Svendson, Stephen Scott, Stephen What more does need my query to get the result in alphabetical order?Thanks!!<{POST_SNAPBACK}> It should be SELECT E_Name FROM Employees_NorwayUNION ALLSELECT E_Name FROM Employees_USA order by e_name asc Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now