how to find first and last record from mysql table
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To get the first record:
select * from tab1 order by col1 asc limit 1;
To get the last record:
select * from tab1 order by col1 desc limit 1;