Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
vishnu chauhan writes "i wanted to fatch records either in odd or even sequence without using cursor. e.g i have 100 records in table and i wanna fatch 1,3,5,7,9................. like thatplease help me the need ful done.vishnu"
X002548
Not Just a Number
15586 Posts
Posted - 2004-07-08 : 12:47:51
Is this an interview question?
USE NorthwindGOCREATE TABLE myTable99(Col1 int IDENTITY(1,1) NOT NULL, Col2 char(1))GOINSERT INTO myTable99(Col2) SELECT SUBSTRING(COLUMN_NAME,1,1) FROM INFORMATION_SCHEMA.ColumnsGOSELECT * FROM myTable99 WHERE Col1/2.00 <> FLOOR(Col1/2.00) ORDER BY Col1GODROP TABLE myTable99GO