Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2006-01-02 : 05:46:43
|
| i want to joing 2 select in which each one of them has its own oreder by but i recive an error!when i remove both of the order by everything is ok - why is that?thnaks in advancepelegIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-02 : 06:39:35
|
| Use it as Derived tableSelect * from(Select .........Union AllSelect .........) TOrder by ........MadhivananFailing to plan is Planning to fail |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2006-01-03 : 09:38:01
|
| If you are joining the select statements as subqueries, you cannot include and ORDER BY statement in a subquery (it is logically pointless anyway). The ORDER BY applies only to the final results set, so you will need to move the clause to your outer SELECT statement. |
 |
|
|
|
|
|