This is a discussion on Sorting in query with Union within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, I am attempting to write a complex query to group sets of data. I have my query working ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I am attempting to write a complex query to group sets of data. I have my query working correctly, but i ran into a problem with sorting. I want to sort my query by a string field. Is there a way around sorting using a field other than numeric of a query containing a union? Thanks, Karen |
| ||||
| On Fri, 24 Oct 2003 13:10:51 -0400, "Karen Bailey" <karenb@centurysystems.net> wrote: >Hi, > >I am attempting to write a complex query to group sets of data. I have my >query working correctly, but i ran into a problem with sorting. > >I want to sort my query by a string field. > >Is there a way around sorting using a field other than numeric of a query >containing a union? > >Thanks, > >Karen > You could do something like: use northwind ( select city from customers union select city from employees ) order by city desc |