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)
 diff value for set of rows

Author  Topic 

chodanvaibhav
Starting Member

4 Posts

Posted - 2009-02-04 : 00:06:38
i am writing a query where i need my first 4 rows column with value say 14 next 4 rows col values 12 and next 4 rows value 10 and so on

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-04 : 00:20:35
Here is my shot:

Select Top 4 Replicate(14,1) as Number
from dbo.spt_values
union all
Select Top 4 Replicate(12,1)
from dbo.spt_values
union all
Select Top 4 Replicate(10,1)
from dbo.spt_values
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-04 : 00:21:12
Run under Master database.
Go to Top of Page
   

- Advertisement -