-1

I am trying to use LIMIT into SQL server 2008 but its not working, what can I do, I am new to SQL I have used mySQL before.

Here is the SQL query I am trying:

SELECT * FROM konto WHERE id_e_klientit = 9 ORDER BY koha_relizimit DESC LIMIT 1
Lavdrim
  • 1
  • 1
  • 1
    LIMIT is a MySQL extension to sql. It's not part of the standard sql language. Sql Server 2012 and later does it the standard way, the standard having only been formally adopted in 2011. Sql Server 2008 R2 and earlier have a different option. – Joel Coehoorn Apr 26 '13 at 00:05

2 Answers2

1

Try SELECT TOP 1 * ...

Also see http://www.w3schools.com/sql/sql_top.asp for more details.

Shawn
  • 8,374
  • 5
  • 37
  • 60
0

In MSSQL it's apparently something like SELECT TOP x * FROM ...

SELECT TOP 1 * FROM konto WHERE id_e_klientit = 9 ORDER BY koha_relizimit DESC
Tom van der Woerdt
  • 29,532
  • 7
  • 72
  • 105