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 新手,我正在查看一些用于医疗办公室的小型数据库的代码。以下是什么意思,它将做什么......我得到的病人,它是数据库中的一个字段。对每个字段重复此代码。
WHERE ( LOWER ( "Patient" ) LIKE ( '%' || LOWER ( :Patient ) || '%' )
它执行不区分大小写的比较,查找"Patient"列包含:Patient参数中传递的子字符串的行。
"Patient"
:Patient
LOWER将两边都转换为小写。
LOWER
||是 ANSI SQL 字符串连接运算符。
||
%在一个LIKE模式中是一个通配符,意思是“匹配任何零个或多个字符的集合”。
%
LIKE
所以如果表达式:Patient是Smith
Smith
WHERE LOWER ( "Patient" ) LIKE '%smith%'