LOWER (Transact-SQL)
將大寫字元資料轉換成小寫之後,傳回字元運算式。
語法
LOWER ( character_expression )
引數
傳回類型
varchar 或 nvarchar
範例
下列範例會利用 LOWER 函數、UPPER 函數,且將 UPPER 函數巢狀放置於 LOWER 函數內,以選取價格在 $11 和 $20 之間的產品名稱。
USE AdventureWorks;
GO
SELECT LOWER(SUBSTRING(Name, 1, 20)) AS Lower,
UPPER(SUBSTRING(Name, 1, 20)) AS Upper,
LOWER(UPPER(SUBSTRING(Name, 1, 20))) As LowerUpper
FROM Production.Product
WHERE ListPrice between 11.00 and 20.00;
GO
以下為結果集:
Lower Upper LowerUpper
--------------------- --------------------- --------------------
minipump MINIPUMP minipump
taillights - battery TAILLIGHTS - BATTERY taillights - battery
(2 row(s) affected)