函數(shù):upper()
功能:將字符串中的小寫字母轉(zhuǎn)換為大寫字母。
語法:Upper( string )
參數(shù)string:要將其中的小寫字母轉(zhuǎn)換為大寫字母的字符串返回值String。函數(shù)執(zhí)行成功時返回將小寫字母轉(zhuǎn)換為大寫字母后的字符串,發(fā)生錯誤時返回空字符串("")。如果string參數(shù)的值為NULL,Upper()函數(shù)返回NULL。
更新table表的name列為大寫:
UPDATE table SET name = upper(name);
在程序中實現(xiàn)大寫查詢:
select * from table where name=upper('admin');
在程序中實現(xiàn)大小寫忽略查訓(xùn):
select * from table where upper(name)=upper('admin');