views:

123

answers:

4

I have tried this which did not work.

select top 5 * from [Table_Name]
+7  A: 
  SELECT * FROM Table_Name LIMIT 5;
Nix
+2  A: 
select * from [Table_Name] limit 5
S.Mark
+3  A: 

An equivalent statement would be

select * from [TableName] limit 5

http://www.w3schools.com/sql/sql_top.asp

Chris J
How do you know it's ServiceLog? ;-)
Michael Krelin - hacker
it was my mistake. i later changed it to [Table_Name]
Amitabh
Ah, no mystery here :-( ;-)
Michael Krelin - hacker
+2  A: 

TOP and square brackets are specific to Transact-SQL. In ANSI SQL one uses LIMIT and backticks (`).

select * from `Table_Name` LIMIT 5;
newtover