View Full Version : "Top Two" Query - Reqd Results not showing

09-08-2006, 02:44 PM
Just a quick one (hopefully!)

I have created the table etc in my database that are required and am just working on the queries. I need to create a query that will display the top two entries of one of my tables....as in from the table of Goalscorers (about 10 entries) i want only the top two with the most "Goals" to be shown.

I have tried a few expressions etc but am not getting the required results to show....

anyone got any ideas?

09-20-2006, 02:50 PM
Microsoft SQL Server
SELECT TOP 2 [columns] FROM table

PostgreSQL and MySQL
SELECT [column] FROM table LIMIT 2

SELECT column FROM table WHERE ROWNUM <= 10

You haven't mentioned which is your database but i hope this will solve your problem.

09-20-2006, 06:35 PM
SELECT column FROM table WHERE ROWNUM <= 1010? Oracle requires one to use binary for integer values?