确实听起来像您想要
UNIOn两个表之间的一个。现在,您得到的是笛卡尔积,这就是为什么结果如此之大的原因:
select *, 'painted' Sourcefrom painteditemswhere visible = 1 and painteditemname = 'itemname1' and painteditemcolor = 'black'union allselect *, 'special' Sourcefrom specialitemswhere visible = 1 and specialitemname = 'itemname1' and specialitemcolor = 'black'
您需要将替换为
SELECT *您的列名。此外,两个查询中的列数和数据类型数必须匹配。
UNIOn ALL将返回两个表中的所有行,如果您只想要
DISTINCT行,则将要使用
UNIOn



