Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
select closing_date,employee_id from shift_details order by sd_id desc LIMIT 0,1


What I have tried:

lang='cs'DataSet ds1 = Globalvariables.Globals.select("select closing_date,employee_id from shift_details order by sd_id desc limit 0,1");
Posted
Updated 20-Oct-22 6:49am
v2
Comments
Richard Deeming 20-Oct-22 4:23am    
Clearly that syntax isn't supported by the DBMS you're using. But since you haven't told us which DBMS you're using, nor which version you're using, nobody can tell you what the correct syntax is. At a guess, try select top 1 ... order by sd_id desc; instead.

1 solution

LIMIT is for MySql, not Sql Server.
You want TOP instead: SQL SELECT TOP, LIMIT, FETCH FIRST ROWS ONLY, ROWNUM[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900