SQL Server7中哪个函数能取出字符串的长度。???(100分)

  • 主题发起人 主题发起人 scorpion
  • 开始时间 开始时间
S

scorpion

Unregistered / Unconfirmed
GUEST, unregistred user!
SQL Server7中哪个函数能取出字符串的长度。???
length()不行。
 
LEN(string_expression)
 
dq right.
len(fieldname) as fieldlength
你可以通过fieldleng取到
 
look this:
LEN (T-SQL)
Returns the number of characters, rather than the number of bytes, of the given string expression, excluding trailing blanks.

Syntax
LEN(string_expression)

Arguments
string_expression
Is the string expression to be evaluated.
Return Types
int

Examples
This example selects the number of characters and the data in CompanyName for companies located in Finland.

USE Northwind

GO

SELECT LEN(CompanyName) AS 'Length', CompanyName
FROM Customers

WHERE Country = 'Finland'



Here is the result set.

Length CompanyName

----------- ------------------------------

14 Wartian Herkku

11 Wilman Kala


 
多人接受答案了。
 
后退
顶部