-
Can you tell me how can I count number of specific character in a string? i.e. I want to count no. of ',' in this string '12.5,44.7,400.25,8.5'. Syntax please.
-
See SUBSTR builtin function syntax.
[url]http://www.dbasupport.com/forums/showthread.php?threadid=6430[/url]
Reddy,Sam
-
Well, using SUBSTR alone can hardly ever give you any usable result with this problem ;).
TRANSLATE seems more appropriate. From your example I conclued you only have numerics, comma and decimal point and space characters in your strings. If so, you can use the following:
SELECT LENGTH(TRIM(TRANSLATE('12.5,44.7,400.25,8.5', ',.0123456789', ','))) FROM dual;
It will return you the number of commas in your string.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|