MySQL Forums
Forum List  »  Microsoft SQL Server

my ansi 92 sql equilanent to TOP gets error
Posted by: Jaime Reza
Date: October 27, 2004 01:00PM

simple table
Users with 2 columns
(userId, userInfo)
userId is integer autoincrements.

I want to do a equivalent of select top 3 from users
this works in mssql


SELECT U1.* from users U1,users U2 WHERE U1.userId = U2.userId
AND (3 > (SELECT COUNT(U2.userId) FROM users U2 WHERE (U2.userId < U1.userId)))

but barfs in mysql

Options: ReplyQuote


Subject
Written By
Posted
my ansi 92 sql equilanent to TOP gets error
October 27, 2004 01:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.