Home » SQL & PL/SQL » SQL & PL/SQL » count the number of 'I'
count the number of 'I' [message #305837] Wed, 12 March 2008 03:02 Go to next message
syamthampiv
Messages: 16
Registered: November 2007
Junior Member
hi all,

Is it possible to write a single select statement to count the number of 'I' in the word 'INDIA' ?..plz help me...thanks in advance...

Re: count the number of 'I' [message #305838 is a reply to message #305837] Wed, 12 March 2008 03:06 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
Yes,and can you post what you tried.This type of question has been asked many time in this forum.

Use : LENGTH and REPLACE.

regards,
Re: count the number of 'I' [message #305841 is a reply to message #305837] Wed, 12 March 2008 03:19 Go to previous messageGo to next message
pablolee
Messages: 2835
Registered: May 2007
Location: Scotland
Senior Member
Did you realise that you posted this in the SQL Experts forum? Do you consider yourself a SQL Expert? Did you bother your ar5e to read the sticky at the top of the forum telling you not to post in the Experts forum unless you can answer 'Yes' to all three of the questions posed in that sticky. The level of question that you have asked is extremely newbie and (as dhananjay pointed out) has been asked and answered many, many times. The next time you post, please consider the level of complexity of the question, if you are in any doubt whatsoever as to which forum to post in, post in the PL/SQL Newbies forum
Re: count the number of 'I' [message #305844 is a reply to message #305841] Wed, 12 March 2008 03:24 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Post moved to correct forum
Re: count the number of 'I' [message #305853 is a reply to message #305837] Wed, 12 March 2008 03:51 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Use this.......

SELECT LENGTH('INDIA') - LENGTH(REPLACE('INDIA','I',''))As "I occurance" FROM dual
Re: count the number of 'I' [message #305861 is a reply to message #305837] Wed, 12 March 2008 04:15 Go to previous messageGo to next message
mshrkshl
Messages: 247
Registered: September 2006
Location: New Delhi
Senior Member
too many methods

http://www.orafaq.com/forum/m/294737/92734/?srch=just+for+fun#msg_294737

regards,
Re: count the number of 'I' [message #305864 is a reply to message #305837] Wed, 12 March 2008 04:34 Go to previous message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Razz Thanks..............

really other options are also there............
Previous Topic: how to get system Specification through pl/sql
Next Topic: Before Drop trigger
Goto Forum:
  


Current Time: Thu Dec 08 12:45:46 CST 2016

Total time taken to generate the page: 0.10068 seconds