I try to find the median value of l from the table chair:
set @r = (select CEIL(COUNT(*)/2) from chair);
select max(l) from chair order by lat_n limit @r;
Is anyone know why I get this error:
ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@r' at line 1