27,582
社区成员




select * from ItemTable where IndexId > 100 and IndexId < 10000 and CategoryId = 130 and ItemId =130
union all
select * from ItemTable where IndexId > 100 and IndexId < 10000 and CategoryId = 130 and ItemId =140
union all
select * from ItemTable where IndexId > 100 and IndexId < 10000 and CategoryId = 130 and ItemId =150
另外,你确定需要union吗,是否可以换成union all,因为我看 CategoryId 都是不一样的,难道这个字段值不一样,itemid一样,会事同一条记录?