0

I'm trying to run the following query:

        SELECT tmp1.post_parent, external_qty, internal_qty
        FROM (
            SELECT wp_posts.post_parent, SUM(wp_shoesol_inventory.qty) as external_qty
            FROM wp_posts
            INNER JOIN wp_variation_sku ON (wp_posts.ID = wp_variation_sku.variation_id)
            INNER JOIN wp_shoesol_inventory ON (wp_shoesol_inventory.sku = wp_variation_sku.sku )
            GROUP BY wp_posts.post_parent
        ) as tmp1
        FULL OUTER JOIN (
            SELECT wp_posts.post_parent, SUM(wp_storage_manager.product_quantity) as internal_qty
            FROM wp_posts
            INNER JOIN wp_variation_sku ON (wp_posts.ID = wp_variation_sku.variation_id)
            INNER JOIN wp_storage_manager ON (wp_storage_manager.variation_id = wp_variation_sku.sku )
            GROUP BY wp_posts.post_parent
        ) as tmp2 ON tmp1.post_parent = tmp2.post_parent 

But it fails with the following message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FULL OUTER JOIN ( SELECT wp_posts.post_parent, SUM(wp_storage_manager.product' at line 9

Thanks to all the helpers!

jarlh
  • 42,561
  • 8
  • 45
  • 63
Hike Nalbandyan
  • 994
  • 1
  • 11
  • 28
  • MySQL has no full outer join support. http://stackoverflow.com/questions/2384298/why-does-mysql-report-a-syntax-error-on-full-outer-join – jarlh Oct 25 '15 at 14:46
  • MySQL dos not support `full outer join`. You can probably use `union all` instead. – Gordon Linoff Oct 25 '15 at 14:48
  • MySQL doesn't support FULL OUTER JOIN. http://stackoverflow.com/questions/4796872/full-outer-join-in-mysql – dchayka Oct 25 '15 at 14:50

0 Answers0