sql >> Database >  >> RDS >> Mysql

MySql Pre-orderboom gewijzigd om url te maken

Zoiets zou voldoende moeten zijn...

SELECT CONCAT_WS('/',x.path,y.page_name) full_path
  FROM
     ( SELECT node.id, GROUP_CONCAT(parent.title ORDER BY parent.lft SEPARATOR '/') path
         FROM category node
         JOIN category parent
           ON node.lft BETWEEN parent.lft AND parent.rgt
        GROUP 
           BY node.title
        ORDER 
           BY node.lft
     ) x
  JOIN pages y
    ON y.category_id = x.id;



  1. PHP/ODBC-coderingsprobleem

  2. Converteer JS date time naar MySQL datetime

  3. MySQL JOIN retourneert NULL-velden

  4. Migreren van Postgres naar SQL Server 2008