Joining on a CASE in MySQL
Trying to implement polymorphic associations in MySQL. I thought the code could look something like this:

    SELECT
    ...
    FROM
    resource
    LEFT JOIN (
         CASE resource.owner_type
           WHEN 'meeting' THEN
             ( SELECT * FROM meeting ) as owner
           WHEN 'todo' THEN
             ( SELECT * FROM todo ) as owner
          END)

But the CASE is causing a syntax error. How can this be rewritten correctly?
Joining on a CASE in MySQL
===

Trying to implement polymorphic associations in MySQL. I thought the code could look something like this:

    SELECT
    ...
    FROM
    resource
    LEFT JOIN (
         CASE resource.owner_type
           WHEN 'meeting' THEN
             ( SELECT * FROM meeting ) as owner
           WHEN 'todo' THEN
             ( SELECT * FROM todo ) as owner
          END)

But the CASE is causing a syntax error. How can this be rewritten correctly?