group concat - PHP MySQL Hierarchy Data group_concat -
any amazing. got following mysql query:
select group_concat( sp.`slug` separator '/' ) `category` sn, `category` sp sn.lft between sp.`lft` , sp.`rgt` , sn.`id` =3 order sp.`lft` asc;
without group_concat function returns desired results in correct order. apply group_contact order mashed , incorrect. know how rewrite query give me concatenated result desired , in correct order?
im @ loss on this. on side note know how rewrite using "inner join" statements opposed 2 table names quoted next each other dont understand how joining 2 tables.
try this:
select group_concat( sp.`slug` order sp.`lft` asc separator '/' ) `category` sn, inner join `category` sp on sn.lft between sp.`lft` , sp.`rgt` sn.`id` =3