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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -