Home > Mobile >  I am getting a SQL syntax error - how to fix it?
I am getting a SQL syntax error - how to fix it?

Time:11-10

I am getting a syntax error in this SQL:

select * 
from messages 
where date > (select lastinterval from messageintervals 
              order by lastinterval desc 
              limit 1)

What is my mistake? Help me please

CodePudding user response:

If this is MSSQL, you should use TOP instead of LIMIT.

select * from messages where date > (select TOP 1 lastinterval from messageintervals order by lastinterval desc)

CodePudding user response:

Can you post error that you are getting

CodePudding user response:

My Friend, ı am getting error bebo incorrect syntax near the keyword limit

  • Related