Welcome Guest, Not a member yet? Register   Sign In
Get Last Record In Each MySQL Group
#1

I need to this SQL query to get last record in each group:

PHP Code:
SELECT idcategory_idpost_title
FROM posts
WHERE id IN 
(
    SELECT MAX(id)
    FROM posts
    GROUP BY category_id
); 


how do can I work with query builder to get last record in each group in codeigniter 4?
Reply


Messages In This Thread
Get Last Record In Each MySQL Group - by viracoders - 02-09-2021, 06:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB