Skip to content
Advertisement

Syntax error to combine left join and select

I’m getting a syntax error at Left Join. So in trying to combine the two, i used the left join and the brackets. I’m not sure where the problem is:

Error:

You have an error in your SQL syntax; it seems the error is around: ‘LEFT JOIN ( SELECT outbound.marketplace_name, outbound.product_t’ at line 9

What could be the reason?

Advertisement

Answer

Place the first limit logic into a separate subquery, and then join the two subqueries:

Note that the select clause of the b subquery can be reduced to just the order_id, as no values from this subquery are actually selected in the end.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement