I am fairly new to sql and am trying to understand the working of Limit. I wrote this code in MySql using the following code inspired by https://stackoverflow.com/a/1309211/11570812.
select count(*) from station as c;
select * from station
order by ID
limit c;
But it throws the following error
ERROR 1327 (42000) at line 2: Undeclared variable: c
Can anyone suggest how to use the value from one query into another query and the reason for this error.