Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Count the number of words in a phrase using Teradata SQL - response (4) by Kawish_Siddiqui

$
0
0

Sree,
This might help you to resolve your issue.

SELECT COUNT(*)+1 
FROM 
(
	SELECT SUBSTR(SENT,POS,1) SINGLE_CHAR
	FROM
	(SELECT 'COUNT WORDS FROM THIS SENATANCE FOR ME' SENT) A, 
	(
		SELECT ROW_NUMBER() OVER (ORDER BY 1) Pos
		FROM sys_calendar.CALENDAR
	) B
	WHERE POS <= CHAR_LENGTH(SENT)
) B
WHERE SINGLE_CHAR = ''

 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>