Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Konvertieren von MySQL-Code in Access:GROUP_CONCAT und ein dreifacher JOIN

Die am häufigsten zitierte Access-Alternative zu MySQL GROUP_CONCAT() Die Funktion ist ConcatRelated() von Allen Browne Funktion, verfügbar hier .

Was Klammern um JOINs angeht, ja, Access SQL ist damit sehr pingelig. Statt

FROM
actor AS a
LEFT JOIN film_actor AS fa ON a.actor_id = fa.actor_id
LEFT JOIN film_category AS fc ON fa.film_id = fc.film_id
LEFT JOIN category AS c ON fc.category_id = c.category_id

versuchen

FROM 
    (
        (
            actor AS a 
            LEFT JOIN 
            film_actor AS fa 
                ON a.actor_id = fa.actor_id
        ) 
        LEFT JOIN 
        film_category AS fc 
            ON fa.film_id = fc.film_id
    ) 
    LEFT JOIN 
    category AS c 
        ON fc.category_id = c.category_id