I have a table with N rows, and I wanna select N-1 rows.
Suggestions on how to do this in one query, if it’s possible..?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
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.
Does the last row have the highest ID? If so, I think this would work:
MySQL does allow subselects in the current version, right?
However, in most cases, it’d probably perform better if you selected all the rows and then filtered the unwanted data out in your application.