我需要从多个联合中选择不同的值。我需要在不同数据库的多个表上使用联合。但是我尝试使用这段代码:
SELECT DISTINCT name ((SELECT name FROM tab1) UNION (SELECT name FROM tab2))
我有这个错误:
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 'UNION (SELECT name FROM tab2 )' at line 1