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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 query related to union and order by

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-09-21 : 07:16:28
rambalak writes "i want to use two select statement with union but i want to use order by only in second query.
Because i want to put first record from first select at top without sorted order and remaining record should be shorted by price with duplicate records"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-21 : 08:37:27

Select columns from table1
Union all
Select * from (Select top 100 percent columns from table2 order by somecol) T

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

rheitzman
Starting Member

16 Posts

Posted - 2005-09-21 : 20:01:58
I don't think you can do that in one statement.

What context are you developing in?
Go to Top of Page
   

- Advertisement -