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
 select record odd id number

Author  Topic 

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2010-04-22 : 01:40:18
hi
i have following table structure
ID Name age
1 A 30
2 b 25
3 c 15
4 d 25
5 e 20
6 f 40
7 g 22
8 h 15
9 i 10

i have get following results
ID Name age
1 A 30
3 c 15
5 e 20
7 g 22
9 i 10

how to write select query

thnaks in advance

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-04-22 : 01:44:29
[code]
select *
from table1
where ID % 2 = 1
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2010-04-22 : 01:46:55
thanks to replay it is working
i have solve both problem of odd or even id records
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-22 : 04:56:01
will ID values be always continuos?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -