Welcome Guest, Not a member yet? Register   Sign In
Problem with Subqueries
#1

Hello, 
I can't transform my sql request into codeigniter,
if someone will help me.
Thank you

SELECT a.id_article, a.title, a.text
FROM articles a
JOIN category c ON a.id_category  = c.id_category 
WHERE a.id_article = (
    SELECT MIN(a2.id_article)
    FROM articles a2
    WHERE a2.id_category  = c.id_category 
    AND c.id_parent = 4
)
GROUP BY c.id_category 
ORDER BY a.id_article ASC
Reply


Messages In This Thread
Problem with Subqueries - by ModeCorot - 09-26-2021, 07:20 AM
RE: Problem with Subqueries - by kenjis - 09-26-2021, 04:00 PM
RE: Problem with Subqueries - by ikesela - 09-27-2021, 03:15 AM
RE: Problem with Subqueries - by ModeCorot - 09-27-2021, 06:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB