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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -