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)
 Migrating from oracle to SQL server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-07-15 : 10:34:39
Biswaranjan writes "I need to convert the following SQL query for SQL server.

SELECT ROWID
FROM emp
WHERE rownum < 2;

Please respond quickly."

Kristen
Test

22859 Posts

Posted - 2004-07-15 : 11:22:35
You need to tackle this with something like

SELECT TOP 2 Column1, Column2, etc.
FROM emp
ORDER BY SomeColumn

where the ORDER BY SomeColumn will bring the appropriate 2 columns to the top of the list.

> Please respond quickly

Why? Are you prepared to pay an expediting fee?

Kristen
Go to Top of Page
   

- Advertisement -