SQL Server store multiple values in sql variable

后端 未结 6 912
春和景丽
春和景丽 2020-12-29 15:02

I have the following query:

select * 
from cars 
where make in (\'BMW\', \'Toyota\', \'Nissan\')

What I want to do is store the where param

6条回答
  •  太阳男子
    2020-12-29 15:12

    why not?

    SELECT * FROM cars WHERE make IN (SELECT DISTINCT(make) FROM carsforsale)
    

提交回复
热议问题