# MySQL利用变量进行查询操作
SET @cityName='Haarlemmermee';
SELECT * FROM city WHERE `Name`=@cityName;
#多个结果查询
SET @cityNames='Haarlemmermee,Breda,Willemstad';
SELECT @cityNames;
SELECT * FROM city WHERE `Name` IN (@cityNames);
SET @cityName1='Haarlemmermeer';
SET @cityName2='Breda';
SET @cityName3='Willemstad';
SELECT * FROM city WHERE `Name` IN (@cityName1,@cityName2,@cityName3);
实际效果: