أبو النوف أبو النوف - 1 year ago 74
SQL Question

mysql , max ,groub by

I'am using mysql database and I'am trying to develop a messages system for private application

i try to get from this table

click to see the photo

to get the information group by ad_id and table_name
with the row have max messages_id

how can i do that whit this table


suggest that if your above SQL statement can query the result. maybe you can just skip the "order by" and simply just

select * from (/* your SQL statement without "order by"*/) a order by a.message_id desc

sorry that as it is difficult to see your screen capture and help you to resolve the SQL script.