how to count no of times a letter occurs in oracle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahulae
    New Member
    • Jul 2008
    • 29

    how to count no of times a letter occurs in oracle

    im trying get the occurence of a particular letter and then depending on that result i have to find the name from table that has more than 1 occurence of particular letter
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    occurance of particular letter from where?...I assume you want those column values which has occurance of particular letter n times??

    n - occurance count of a particular letter

    Comment

    • rahulae
      New Member
      • Jul 2008
      • 29

      #3
      for example there are three names in table

      ADAMS
      DAVE
      SMITH

      i should get the name that has two A's in it

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        you need to use string functions like SUBSTR,INSTR and LENGTH for the prpose.

        Comment

        • rajeshvakkala
          New Member
          • Feb 2009
          • 2

          #5
          Hi,
          can u explain with an example


          Regards,
          raj

          Comment

          • amitpatel66
            Recognized Expert Top Contributor
            • Mar 2007
            • 2358

            #6
            Try this:

            [code=oracle]
            SQL> select * from emp where address like '%A%A%';

            EMPNO ADDRESS
            ---------- --------------------------------------------------------------------------------
            10 ADAM
            20 123 abc road, texas,USA - 123

            SQL>
            [/code]

            Comment

            Working...