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
 General SQL Server Forums
 New to SQL Server Programming
 Query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-01-18 : 08:56:41
kannadasan writes "selecting alternate rows from a table in sqlserver.

ie; To display only odd rows or even rows."

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-01-18 : 09:15:01
alternate rows in which order ?
What is the purpose ?
Give some sample data and y u want it?
U can use the front end application to do such - using devide by 2 - remainder being 0 or 1 theory
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-18 : 09:55:06
If you have identity key with continuous sequence

Select columns from yourTable where id%2=1

Madhivanan

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

druer
Constraint Violating Yak Guru

314 Posts

Posted - 2006-01-18 : 14:34:33
Now I'll be wondering all night long "what in the world would lead someone to want to select every other row of data from a table?" Because I know this will never get answered. aaaaaaaaaggggh.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-19 : 03:46:05
quote:
Originally posted by druer

Now I'll be wondering all night long "what in the world would lead someone to want to select every other row of data from a table?" Because I know this will never get answered. aaaaaaaaaggggh.


May be only for Testing

Madhivanan

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

- Advertisement -