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)
 MS SQL Query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-07-08 : 12:00:55
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 that
please 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 Northwind
GO

CREATE TABLE myTable99(Col1 int IDENTITY(1,1) NOT NULL, Col2 char(1))
GO

INSERT INTO myTable99(Col2)
SELECT SUBSTRING(COLUMN_NAME,1,1) FROM INFORMATION_SCHEMA.Columns
GO

SELECT * FROM myTable99 WHERE Col1/2.00 <> FLOOR(Col1/2.00)
ORDER BY Col1
GO

DROP TABLE myTable99
GO





Brett

8-)
Go to Top of Page
   

- Advertisement -