Ask you greatly enlighten a sql

Category: MS-SQL Server -> Foundation Classes Author: sky89855297 Date: 2006-07-27 17:14:44
 
sky89855297
2006-07-27 17:14:44
Requirements: Retrieve a field length if the length is 4 to return the original string length is 3 if the character with the character '0 '+ string

Solution:

select decode (length (f.areacode), 3, to_char (0 + f.areacode), 4, f.areacode) from xxx

question: to_char (0 + f.areacode) This method can not realize how to achieve splicing

character length is 3:00 query returns '0 '+ character

example, 234 returned 0234

ask you greatly enlighten

ps: Results posted rates are posted in the water caused no statement posted
huangming77
2006-07-27 17:21:53
4 F = 40 points, thank LZ
yelmlow
2006-07-27 17:38:48
4 F = 40 points, thank LZ
husunzhi
2006-07-27 17:48:47
jfsx ... reply is too short ...
jiaxuan0925
2006-07-27 18:06:18
9 F = 50 points, thank LZ
charliechao1
2006-07-27 18:17:43
Deleted Replies deleted so fast? You still go to the Water District Results posted it. .
xingchen1980
2006-07-27 18:30:29
Results posted it ...
caihou024
2006-07-27 18:44:43
uh original use '0 '| |' results' on it. . . . .
deathseed
2006-07-27 19:02:52

sharing
broad0506
2006-07-27 19:09:44
Deleted Replies deleted so fast? You still go to the Water District Results posted it. .
jwj97
2006-07-27 19:17:43

...