Results 1 to 6 of 6

Thread: help me pl/sql

  1. #1
    Join Date
    Oct 2011
    Posts
    4

    Unanswered: help me pl/sql

    i'm new with pl/sql an i need to wrote a code that display the most common 20 words from a string.
    Thank you!

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    What are the "most common 20 words from a string"? Any example?

  3. #3
    Join Date
    Oct 2011
    Posts
    4
    i have the string "car car run car run car car run run run word word word" and the program will return car=5, run=5

  4. #4
    Join Date
    Oct 2011
    Posts
    4
    Quote Originally Posted by Littlefoot View Post
    What are the "most common 20 words from a string"? Any example?
    i have the string "car car run car run car car run run run word word word" and the program will return car=5, run=5

  5. #5
    Join Date
    Oct 2011
    Posts
    4
    i have the next code..i need some help because don't shows the result.Thank you!

    create or replace
    function p_cuvinte() return VARCHAR2
    IS
    data VARCHAR2(1000);
    nb NUMBER;
    words VARCHAR2;
    begin

    with
    data as ( select 'car car run car run car car nd run nd nd nd nd run run word word word' val from dual ),
    nb as ( select level nb from dual connect by level <= 15 ),
    words as (
    select regexp_substr(val, '\w+', 1, nb) word
    from data, nb
    )
    select word, count(*) nb
    from words
    group by word
    end;

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •