CodeSnip: Practical Use of Translate Function in Oracle
page 2 of 4
by Deepankar Sarangi
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 5413/ 91

Problem Statement

The above stated problem can be represented as the figure below. Let us say we have a table consisting of two fields as NAME and ID and has been maintained as follows.

Figure 1

In order to find out how many names are there in the NAME field we cannot put sum function across it. This is because by putting sum across the NAME we will find only 5 instead of 17.

Listing 1

select sum(length(name) - length(translate(name,' ,',' '))+1) NAMES 
from multiple_id;

Figure 2


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 2 and 8 and type the answer here:

User Comments

No comments posted yet.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2009 ASPAlliance.com  |  Page Processed at 1/8/2009 1:21:14 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search