日期:2014-05-18 浏览次数:20557 次
将大写字符数据转换成小写后返回字符表达式。 语法 LOWER ( character_expression ) 参数 character_expression 字符数据类型或二进制数据类型的表达式,或者可以隐式转换为 nvarchar 或 ntext 数据类型的表达式。
------解决方案--------------------
LOWER 将大写字符数据转换为小写字符数据后返回字符表达式。 语法 LOWER ( character_expression ) 参数 character_expression 是字符或二进制数据表达式。character_expression 可以是常量、变量或列。character_expression 必须是可以隐性转换为 varchar 的数据类型。否则,使用 CAST 显式转换 character_expression。 返回类型 varchar 示例 下例在选择价格位于 $11 和 $20 间的书名时,使用 LOWER 函数、UPPER 函数并把 UPPER 函数嵌套在 LOWER 函数内。 USE pubs GO SELECT LOWER(SUBSTRING(title, 1, 20)) AS Lower, UPPER(SUBSTRING(title, 1, 20)) AS Upper, LOWER(UPPER(SUBSTRING(title, 1, 20))) As LowerUpper FROM titles WHERE price between 11.00 and 20.00 GO 下面是结果集: Lower Upper LowerUpper -------------------- -------------------- -------------------- the busy executive's THE BUSY EXECUTIVE'S the busy executive's cooking with compute COOKING WITH COMPUTE cooking with compute straight talk about STRAIGHT TALK ABOUT straight talk about silicon valley gastr SILICON VALLEY GASTR silicon valley gastr secrets of silicon v SECRETS OF SILICON V secrets of silicon v prolonged data depri PROLONGED DATA DEPRI prolonged data depri fifty years in bucki FIFTY YEARS IN BUCKI fifty years in bucki sushi, anyone? SUSHI, ANYONE? sushi, anyone? (8 row(s) affected)
------解决方案--------------------
CHARINDEX(myinfo,'reInfo') <>0
------解决方案--------------------
不能直接操作 ntext,text之类数据,这类数据有专用函数操作,比如textptr等等。