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