mySQL: Issue with Left Join -


i have following query:

 select c.`entity_id`,c. p.`name` parent_id, c.`name`   category c   left join category p c.`parent_id = p.id   c.is_active = 1   order c.parent_id asc, c.position asc; 

but error on first clause, can spot error here? thanks

you have added where clause twice. try below :

select c.`entity_id`,c. p.`name` parent_id, c.`name` category c   left join category p on c.`parent_id = p.id   c.is_active = 1   order c.parent_id asc, c.position asc; 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -