LCASE 函数把字段的值转换为小写。
SELECT LCASE(column_name) FROM table_name
我们拥有下面这个 "Persons" 表:
Id | LastName | FirstName | Address | City |
---|---|---|---|---|
1 | Adams | John | Oxford Street | London |
2 | Bush | George | Fifth Avenue | New York |
3 | Carter | Thomas | Changan Street | Beijing |
现在,我们希望选取 "LastName" 和 "FirstName" 列的内容,然后把 "LastName" 列转换为小写。
我们使用如下 SQL 语句:
SELECT LCASE(LastName) as LastName,FirstName FROM Persons
结果集类似这样:
LastName | FirstName |
---|---|
adams | John |
bush | George |
carter | Thomas |
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛