Skip to content
Advertisement

MySQL problem joining 2 tables with UNION

I’m doing UNION in MySQL that I’m unable to troubleshoot for a while. Error says that

syntax is incorrect around t1.*

Those 2 SELECTs work ok separately, checked. But UNION fails. I’m not custom to MySQL syntax, maybe something is wrong with that.

Advertisement

Answer

You are using parenthesis around your SELECT field, this is your syntax error origin (the UNION is not the cause). Just remove them:

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