mysql - cannot use offset and limit in stored procedure -
currently using offset , limit retrieve limited data table, when move database development hosting server, show syntax error on query, if remove offset , limit syntax, work well. idea or solution on problem?
select e.a, e.b, e.c, e.d, e.e, e.f, e.g t1 e e.a = 1 order e.b desc limit in_count offset in_offset; 
as per official mysql site :
for compatibility postgresql, mysql supports limit row_count offset offset syntax.
i think syntax proper, problem may reside procedure variables being used in limit/offset clause, or way being interpreted database engine might have older incompatible version not interpret offset.
as alternative workaround, try using , comma separation in limit clause specify offset, might solve issue.
select e.a, e.b, e.c, e.d, e.e, e.f, e.g t1 e e.a = 1 order e.b desc limit in_offset,in_count;
Comments
Post a Comment