If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Location: The extremely Royal borough of Kensington, London
Posts: 778
Oracle:
Select columns
from table
where rownum <= 5
SQL Server 2000:
Select top 5 columns
from table
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.
Location: The extremely Royal borough of Kensington, London
Posts: 778
This query will work in MS SQL Server 2000:
Code:
Select top 5 *
from table
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.
Looks like you are using MySQL, not Microsoft SQL Server. the TOP statement works in Microsoft SQL Server but I don't think it is in MySQL as a valid statement.