Re: Union Query Sorting

2004-03-13 Thread Egor Egorov
"Ed Reed" <[EMAIL PROTECTED]> wrote: > Can anyone tell me how to sort the combined results of a Union query? > Right now I have a Group By and Order By in both of my queries that make > up my Union but the results are grouped and sorted within the two > queries but not between the two queries. The

Re: Union Query Sorting

2004-03-13 Thread Michael Stassen
And if you're sorting by Name in the end, you don't really need to sort by Name in each SELECT: (SELECT Name FROM Employee Group By Name) UNION (SELECT Name FROM Consultant Group By Name) ORDER BY Name; Do you expect the same Name in multiple rows in these tables? If not, you can drop t

re: Union Query Sorting

2004-03-13 Thread Ed Reed
Thanks Jeremy, That was easy. - Ed >>> Jeremy March <[EMAIL PROTECTED]> 3/12/04 7:42:12 PM >>> > Can anyone tell me how to sort the combined results of a Union query? > > (Select Name From Employee Group By Name Order By Name) > Union (Select Name From Consultant Group By Name Order By Name);

re: Union Query Sorting

2004-03-12 Thread Jeremy March
> Can anyone tell me how to sort the combined results of a Union query? > > (Select Name From Employee Group By Name Order By Name) > Union (Select Name From Consultant Group By Name Order By Name); > Just add another order by on the end after the parenthesis: (Select Name From Employee Group B