Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个 sql 命令:select name from criminals where name || surname like '%SH%' order by id;
select name from criminals where name || surname like '%SH%' order by id;
问题是我的结果也显示了名字“LambroS”“Hitiris”,因为姓氏字母和第一个姓氏字母形成“SH”。我该如何解决?如果其中任何一个包含这些字母,我想显示结果。
您也可以尝试使用 OR:
select name from criminals where name like '%SH%' OR surname like '%SH%'
试试这个:
SELECT NAME FROM CRIMINALS WHERE NAME || ' ' || SURNAME LIKE '%SH%' ORDER BY ID;