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
 Fetch odd rows and even rows from a table

Author  Topic 

kiruthika
Yak Posting Veteran

67 Posts

Posted - 2008-04-04 : 07:59:02
Dear Friends,
Is there any way to display a table data separately like odd rows and even rows?I dont know this is possible or not?If it is possible means how can i achieve it?Please guide me a proper way.
Thanks all!

kiruthika
http://www.ictned.eu

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-04-04 : 08:04:31
See this:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=63512&SearchTerms=ODD,even
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=83878&SearchTerms=ODD,even

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

yaman
Posting Yak Master

213 Posts

Posted - 2008-04-04 : 08:26:26
use this code
For get even rows
select * from table_1 where id%2=0
For get odd rows
select * from table_1 where id%2<>0

Yaman
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-05 : 02:53:36
quote:
Originally posted by kiruthika

Dear Friends,
Is there any way to display a table data separately like odd rows and even rows?I dont know this is possible or not?If it is possible means how can i achieve it?Please guide me a proper way.
Thanks all!

kiruthika
http://www.ictned.eu


In any case you need unique key in your table

Madhivanan

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

- Advertisement -