I have a table in my database which has 4 columns
ID
CATEGORY
NAME
DATA
How could I retrieve the last inserted value of DATA which is filtered by CATEGORY
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.
It isn’t clear whether you want the last value for a given category, or by category, so here’s both solutions:
For a given category:
For all categories:
Note that the second query is a mysql-only solution, but since this is a mysql question, this will work.