How can I select from in other select in MYSQL query? Something like this
SET @row_number = 0;
SELECT a.num FROM
(SELECT
(@row_number:=@row_number + 1) AS num, id
FROM
main) as a where a.id=6
I want to know the number of record where id=6 if it's the first row, second row or third one
please anyone can help me.