select * from Department where DeptName like '%'+@DeptName+'%
like 用concat连接字符串
SELECT * FROM Department WHERE DeptName LIKE CONCAT('%',@DeptName,'%') ;
谢谢!
select * from Deparement where DeptName like '%'+@DeptName+'%'
因为mysql中 ,参数化是用?
so,语句如下:select * from Department where DeptName like '%'+?DeptName+'%'
多了个 单引号,在%里面 不想用引号
string word="12"
string sql="select * from Department where DeptName like '%"+word+"%'"