Converting MySQL code to Access: GROUP_CONCAT and a triple JOIN

后端 未结 1 963
不思量自难忘°
不思量自难忘° 2020-12-10 21:44

I\'m having a really hard time translating a piece of MySQL-code to Access. I\'m trying to use one of the queries found in the Sakila (MySQL) Database for an Access project

1条回答
  •  爱一瞬间的悲伤
    2020-12-10 22:44

    The most commonly-cited Access alternative to the MySQL GROUP_CONCAT() function is Allen Browne's ConcatRelated() function, available here.

    As for parentheses around JOINs, yes, Access SQL is fussy about those. Instead of

    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
    

    try

    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
    

    0 讨论(0)
提交回复
热议问题