MySQL中的用户输入值

时间:2019-05-01 22:07:15

标签: mysql sql

我有以下代码:

select  p.personID as "Person ID",
    p.personname as "Person Name",
    c.name as "City Name",
    h.dateArrived as "Date Arrived",
    y.Name as "Country Name"
from    country y
join    city c
on      c.CountryCode = y.Code
join    hasvisitedcity h
on      h.cityID = c.ID
join    person p
on      p.personID = h.personID
where y.Name LIKE '%i%'
Order by p.personID;

这很好用,但是具有硬编码的 Like 搜索功能。我想添加一种方法,用户可以输入搜索参数(例如land),并将该参数传递到倒数第二行进行匹配。

这可能吗?

0 个答案:

没有答案