County, based on the soundex function

Hi all

I a bit confused with request asked of me.
the query is
indicate the account number of the last part of each word in the same row according to the soundex function
for example
the first line has set out four in the same line
ACD BCD AAA
AFD BCF
BDE AAC AFC
BCF AAE
Does it say I have divided the each statement and get soundex for the last part which is located in this example is------.
AAA
BCF
AFC
AAE 
So the soundex only for AAA and AAE is same average I've update table b in the column of Gen by two and son on for others.
create table  a(id number(9), Gen_Value varchar2(200));

insert into a vlaues(1, 'ACD BCD AAA, AFD BCF , BDE AAC AFC,BCF AAE');
insert into a vlaues(2, 'AVF BCD, BBA BBG BCEV, GACD MNF BCV');
insert into a vlaues(3, 'AFC ABC, BBG HUH ABCE, JHU KK MNK');


create table  b(id number(9), Gen_Value varchar2(200), id number(9));
insert into b values( 'AAA', '0',1);
insert into b values ('BCEV  ','0',2);
insert into b values ('AFC','0',1);
insert into b values ('BCD','0',2);
insert into b values ('MNK','0',3);
insert into b values ('ABCE','0',3);
The result is
Gen   count  id 
AAA    2     1
BCEV   2     2
AFC     1     1
BCD     1     2
MNK    1     3   
ABCE  2     3
see you soon
Benjamin

Published by: 973907 on November 29, 2012 12:54 AM

Published by: 973907 on November 29, 2012 12:55

973907 wrote:
We choose one of them. 'AAA' or AAE. or the word that has long term.

No prob

with data as (
 select
  id
 ,gen_value||',' gen_value
 from a
)
,r  (id, gen_value, l) as (
 select
  id
 ,substr(gen_value, instr(gen_value, ',') + 1)
 ,substr(
   trim(substr(gen_value,1, instr(gen_value, ',') - 1))
  ,instr(trim(substr(gen_value,1, instr(gen_value, ',') - 1)),' ',-1)
 )
from data
union all
 select
  id
 ,substr(gen_value, instr(gen_value, ',') + 1)
 ,substr(
   trim(substr(gen_value,1, instr(gen_value, ',') - 1))
  ,instr(trim(substr(gen_value,1, instr(gen_value, ',') - 1)),' ',-1)
 )
from r
where
length(gen_value) > 0
)

select
 soundex(l)
,count(*) cnt
,max(l) keep ( dense_rank last order by length(l), l desc nulls first) v
from r
group by
 soundex(l)
order by
 1

SOUNDEX(L) CNT V
A000 2 AAA
A120 3 ABCE
B210 3 BCEV
B230 1 BCD
M200 1 MNK 

Tags: Database

Similar Questions

  • Customize a page based on the SQL function

    Hello

    Please someone help me solve this problem.

    In a page I am Image. By clicking on the image, a page will open. The image is created using the code of the controller.

    The values are displayed in the second page based on the clicked image.

    While the page is being prepared a SQL function must obtain an entry and based on the input TextField should be changed to read-only or not.

    Thanks in advance,
    Roselyne

    There is no log file for OFA...

    Set the profile FND: Diagnostics to 'yes '.

    You can see the error on the screen.

    Prasanna-

  • search based on the filter function

    Hello

    I have a filter function that does this,

    private void filter_handler(item:Object):Boolean
    {
    var isMatch2:Boolean = false;
    If (item.name.search ('(Joe)')! = - 1).
    {
    isMatch2 = true;
    }
    Return isMatch2;
    }
    When I do this, the search function ignores the parentheses and the outputs 'Joe' and '(Joe). What I wanted to do came out alone "(Joe). Anyone know why the search function ignores the parentheses?

    Thank you.

    Look at the source of this example view. -What are you trying to accomplish?
    http://www.anaheimwib.com/_comps/filtering/

  • Report based on the result of the sorting function?

    Dear all,

    I will make this issue in general terms:

    We have a report based on a query that reads data from a single table (P). It will take to provide a field more (X) in the report which is obtained using more than two tables (E, 1 m approx).

    I wrote a function that produces this extra field based on a join of tables E and P1. Please note that this function depends on the report query variables. This output is correct and provides all the necessary information, but it is necessary to sort the report based on the result of this function, i.e. the value of field X.

    Is this possible?

    I appreciate your comments.

    Note: I've tried incorporating pictures E, P1 in the request report (I can then sort on the required field) but gets reduced the number of lines in the report. This is because the join between the tables, P, E and P1 reduces the number of lines (which is not the correct result).

    Yes, it is possible. If you have ended up above a formula column.

    Create the formula column. For example, CF_SALARY_TOTAL. Place a level to the top of the query and set your desired sort (Asc/Desc)

    Hope this helps

    Hamid

    Move or

  • highlight the function on that I am based on the line of code that I'm

    I tried, but I couldn't find the right combination to find an answer, so sorry if this has been asked before.

    I find myself with 'find the database object' a lot, which is great, when I'm looking for a line of source code.  When I click on the result and get to the line of source in the body, I do a lot of scrolling sometimes to understand what I am in the service.

    Is there a way to have SQLDeveloper highlight automatically the function in the connections tree based on the line of my cursor is on in the code editor?

    Thank you very much in advance.

    In version 4, if you look at the bottom of your editor, you will see the navigation breadcrumbs, which will tell you where you are at.

  • Hide/show elements based on the result of the existing function

    Hello

    I have a function that returns two values that are drawn from a process of application On Demand (thanks Shijesh!):
    function myAjaxCall()
    {
       var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=getStatus',0);
       ajaxRequest.add('P11_PATIENT_ID' , $v('P11_PATIENT_ID'))
       //notice the below line.. use of split function
        ajaxResult = ajaxRequest.get().split(',')
       $s( 'P11_CCSS_STATUS' , ajaxResult[0]);
          $s( 'P11_COPAY' , ajaxResult[1]);
    }
    I'm trying to hide/show the other two items (P11_COPAY_COLLECTED, P11_NO_COPAY_REASON) based on the return value for P11_COPAY.

    Is it possible to add an IF statement for the function to show the two elements only if the value is equal to 'Yes'?

    I tried this, but then the two values (P11_CCSS_STATUS, P11_COPAY) are not returned, much less any hide/show:
    function myAjaxCall()
    {
       var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=getStatus',0);
       ajaxRequest.add('P11_PATIENT_ID' , $v('P11_PATIENT_ID'))
       //notice the below line.. use of split function
        ajaxResult = ajaxRequest.get().split(',')
       $s( 'P11_CCSS_STATUS' , ajaxResult[0]);
          $s( 'P11_COPAY' , ajaxResult[1]);
    
    if ( $v ('P11_COPAY' == 'Yes' ) { 
         $x_ShowItemRow('P11_COPAY_COLLECTED');
         $x_ShowItemRow('P11_NO_COPAY_REASON');
    }
    else 
    {
      // Show Items 
    $x_HideItemRow( 'P11_COPAY_COLLECTED');
    $x_HideItemRow( 'P11_NO_COPAY_REASON'); 
    }
    }
    Any suggestion on how / if possible?

    Thank you
    Matt
    if ( $v 'P11_COPAY' == 'Yes' )
    should be
    if ( $v ('P11_COPAY') == 'Yes' ) 
    

    CITY

  • Graph based on the function of PL/SQL returning the sql query

    Hello, is it possible to have a chart based on PL/SQL return SQL function as with the reports.
    If I need to present data that is based on the graph and the graph itself, and the report is based on the function PL/SQL, SQL back then how I do the table if this is not possible? Also, is there a way to specify which columns in the report to use for the chart instead of having to specify the same question again on the list - this seems a bit redundant.

    Ah, OK - one HTML table does not offer the possibility of using the PL/SQL (I don't know why, if)

    However, you can create a collection (using the APEX_COLLECTION. Function CREATE_COLLECTION_FROM_QUERY) from your vSQL of string and then basing the chart on that?

    Andy

  • Offshoot of page based on the return value of function

    I have a combo box (P2008_SUPPORTING_MATERIALS) with 'Yes' and 'No' values.

    I need a button that will save the selected value, and then create a branch to the 1092 page if it of 'Yes' or branch to page 2094 if it is 'no '.

    That's what I did:

    1 create a SAVE button
    2. created a page process of type PL/SQL with function (see code below) inside (PageBranchDecision). The conditional processing I put him "when press button" for the "SAVE" button.
    3. create a branch of the page with a branch type of DIRECTION to the FUNCTION RETURN A PAGE. For the action of the branch, I put the name of the procedure on the page (PageBranchDecision). Because these are conditions, I defined him "when press button" on the "SAVE" button.

    This is the code for the page process:

    DECLARE
    whole n_page_id;
    v_sup VARCHAR2 (3);

    BEGIN
    v_sup: =: P2008_SUPPORTING_MATERIALS;

    IF v_sup = "Yes".
    THEN
    SELECT 1092 INTO double n_page_id;
    RETURN n_page_id;
    ON THE OTHER
    SELECT 2049 INTO double n_page_id;
    RETURN n_page_id;
    END if;

    END;

    Now, that's the problem... According to the 'Oracle HTML DB manual"page 294 books and ' easy Oracle HTML-DB' page 307, with the type of the branch of 'Branch to function returning a Page', a function PL/SQL is written which returns a digital page at junction id. In my code, it would be 'n_page_id '. But, when I run my page and click on my "SAVE" button I gives me an error that a RETURN statement cannot contain an expression.

    I don't know why I get this error. I need to get the value of the page to the branch based on the 'yes' or 'no '.

    Someone has an idea what I am doing wrong? My situation seems, as it is possible through the logic, I'm following?

    Thanks in advance,
    Maggie

    ch - ensure that any unconditional branch on the page has a largest number in sequence to ensure that this branch is triggered and ensure that there is no other branch that is triggered by the "SAVE" button

  • assign the number to a line based on the analytical condition function

    Oracle 11g Server

    ID val1 val2
    100a
    110 b
    120c
    200a
    220 b

    WITH input AS
     (SELECT 1  id
            ,0  val1
            ,'0a' val2
        FROM dual
      UNION ALL
      SELECT 1  id
            ,1  val1
            ,'0b' val2
        FROM dual
      UNION ALL
      SELECT 1  id
            ,2  val1
            ,'0c' val2
        FROM dual
      UNION ALL
      SELECT 2  id
            ,0  val1
            ,'0a' val2
        FROM dual
      UNION ALL
      SELECT 2     Id
            ,2val1
            ,'0b'    val2
        FROM dual)
    SELECT * FROM input;
    
    !-[CodeBlockEnd:ae52826b-04c5-4aa4-a6c0-1d0405656e55]-->

    Output:

    ID val1 val2 assigned_number
    100a0
    110 b0
    120c2
    200a0
    220 b1

    The dense numbering sequence must be assigned to each line based on the column id and val1.

    For an identifier given, the numbering begins only after val1 > 1 until then the assigned_number will be zero.

    WITH the entry INTO

    (SELECT 1 id)

    0 val1

    '0' has val2

    OF the double

    UNION ALL

    SELECT 1 id

    1 val1

    b '0' val2

    OF the double

    UNION ALL

    SELECT 1 id

    2 val1

    , 0'c ' val2

    OF the double

    UNION ALL

    SELECT 2 id

    0 val1

    '0' has val2

    OF the double

    UNION ALL

    SELECT the Id 2

    2val1

    b '0' val2

    THE DOUBLE)

    SELECT id, val1, val2,

    Rank() over (partition by order of case when val1 > 1 then 0 otherwise end val1) dr-1

    SINCE the entry;

    ID VAL1 IS DR

    ---------- ---------- -- ----------

    1          0 0a          0

    1          1 0b          0

    1          2 0c          2

    2          0 0a          0

    2          2 0b          1

  • Needs of JavaScript function to fire based on the value set by a checkbox

    Hi all, I'm doing my best to learn javascript on http://www.w3schools.com and hoped not to have to ask this kind of questions, but until what I fully educated I am a bit stuck.

    I run a function on a page of the apex that checks the value of a LOV column in a table, and then did some stuff. This code works fine if it is assumed that the column I'm evaluating is displayed as ' select list - static LOV. If I change the column to display a check box, and then copy the following code no longer works. How should I change this to be able to read the value when the value by a checkbox instead of a LOV?
    var currIndex = $('select[name="'+pThis.name+'"]').index(pThis);
     // check current items value (return value of lov)
     if (pThis.value=='Y') 
    Also, my function works when a user sets the value after the page is displayed, but I also need it to do such things even on page load. Can I just copy the function in the body of the html page? Perhaps, if someone can just point me in the right direction, I can continue to research. I know there have been discussions on this, but I'm still not entirely clear on how to achieve this.

    Thanks in advance everyone to continue to teach me the apex.

    John

    Hello

    You had error on the JavaScript function test

    if (pThis.value=='Y' {
    

    There is lack of support.

    Plugin UILayout gives also some JavaScript errors, so I State never to that.

    Kind regards
    Jari
    -----
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • ID/faces of the people in the Sierra pictures, pulling up the non-functional names

    Someone knows how to fix this? Is it a new setting I'm missing? I've already sent feedback to Apple.

    Photos, when I come across a photo of a person without a name, I can click on the field "no name" and a list of names appears. In the Sierra, however, the list includes names of new non-functional based on the e-mail addresses that are causing problems with my library.

    For example, if I type my name, I see three suggestions:

    1. my full name, with the thumbnail associated with my Photos 'face '.

    2. my full name with my email from Apple below address and the photo of my Contacts entry

    3. my full name with a secondary e-mail, which I have also listed in Contacts, with no tile

    If I take 1, everything works as usual.

    If I take 2 or 3, Photos makes a new person with just my name. It does not automatically fill in the rest of my name. I find myself with two entrances of the person, one with my full name and one with my name. I then merge these. This happens with all the people, not just me.

    I have the same problem. When I want to manually add a face without a name/person, I get very often 2 proposals:

    (1) the person sought with the profile photo, the first name and family name. If a picture is displayed, this means that I have already assigned photos to this person.

    (2) the same person, with or without a profile picture, with name, surname and e-mail. This proposal seems to come from my contacts, because it shows the same profile photo and mail the address I have for this person in my contacts.

    If I add the photo to the contact person, the person is added as a person in Photos. But with only the name, not the name, which is a little ridiculous, especially when you are systematically adding people and having many with the same name.

    I merge the two to get back 1 "individual" in photos, with first and last name (first and last).

    So somehow Photos is not capable of matching 'people' in photos to anyone in my contacts list. Even when you merged the two and said Photos this way they need to be put in correspondence.

  • Satellite A210-1BX - error based on the CD/DVD drive

    Hello

    I have a problem with my DVD writer! I use Nero and if I burn MP3 CD or DVD .avi files happens whenever an error based on the drive. No detail!
    But on the CD are the opder of 1/2 3/4 data!
    If I insert an .mp3 CD Windows Vista said, the CD is empty! Vista is already NEW!

    Can someone help me? Or I have to contact Toshiba, I guarantee!

    Thank you

    Hello!

    Have you checked the site factory of Nero for an update? Maybe it s just a software problem that the burning procedure fails.
    In addition, you can try another burning program. A few days ago, I tested CD BurnerXP and I was very surprised! It s a freeware program and it also contains a large number of functions that it s worth a try! ;)

    Here in the forum I noticed that the dismantling of the upper and lower filters can often solve problems with the CD/DVD drive to check of workaround from Microsoft:
    http://support.Microsoft.com/kb/314060

    Good bye

  • VBAI: Fire a pulse each msec N based on the State of inspection

    The delay function VBAI seems to have the functionality I'm looking for, but that is so rude that the time is 1 second minimum.

    I have a camera intelligent (1772). I do an OCR inspection that could take a variable quantity a little time. I would like an ejector will trigger if the inspection fails. The ejector must fire on a set amount of time after which the camera fires. If I can't do reliable, so I need another controller in the system that I should not need because the camera smart shoulkd be more than enough. I know it can be done in the RT, but I like to keep things in VBAI to facilitate customer training.

    Sequence of operations:

    1. travel less than 1772 on a conveyor parts

    2 sensor triggers 1772 when a part is present

    3 image is acquired and processed. OCR inspection

    4. If the OCR inspection fails, the output pulse fire exactly 100 (for example) milliseconds after the onset of step 2

    5. Repeat step 2

    No idea how to achieve this in VBAI?

    Thank you

    Dan

    You might have a step to generate impulses before your acquisition where the impulse is configured to generate a pulse based on a trigger (so set up a continuous pulse and you wire trigger for acquisition to an ISO so input line that will trigger the output). Now, this is the important part... you must ensure that your treatment is carried out before 100ms or some delay that you specify or the pulse will begin. If you determine that you need not pulse according to your treatment, the transition to a State where stop you a generation of pulses on this line to stop it before that happens. In both cases, passage to the final State, and then the inspection can start again with the State which has run impulses/Acquire/processes and therefore the pulse reconfigure again for the next part.

    If this does not work for you, then you can try a timed SW approach. You might have a running LabVIEW step that gets a precise timer value during the acquisition stage ends, and another VI call waiting for a specified duration user (millisecond resolution) before it continues.

    I recommend the first option because it will be hardware timed (but requires additional cables), and if it does not, I can help you with a VI that will make the timed SW the desired behavior.

    Hope that helps,

    Brad

  • How to use the node function call library for a function in the dll with the data SUB type

    Hi all

    I would ask for your kind help

    I am facing a problem with the call library node.

    I have a C++ (stdcall) function, which has Sub as data type

    XXXX error code (hwnd, lid, getValue, * Sub data1, * Sub data2)

    data1 and data2 types are constantly changing based on the value of 'getValue '.

    Mainly I can use the call library node several times and adapt each node according to the types of data data1, data2 and extract the values and use in the code. Here is no question. Real question is:

    My question:

    How can I use a node of library time call and make a case according to the 'getvalue', who will control the data1, data2 data type. Here I really seeking solutions.

    My tests:

    I used varaints as entry to the libray call node of the data1, data2 and selected parameters in the call libraby node as "Adapt to type. Here labview just crashed.

    I appreciate your suggestions to feedbackand.

    Thank you

    Karine

    You must allocate enough space for data1 and data2, and then pass a pointer to this space. An easy way to do this is the function to initialize table. Set the U8 type and size for the number of bytes required. Pass this array to the function as a pointer of table data.

    After the function call returns, you need to extract the data in the table. You can do it manually, but a simple approach is to use the array of bytes to a string. Then, in a housing structure, use Unflatten chain to convert the string to the correct data type. This method also converts the "endianness" which will be probably necessary; Be sure to only set all entries for unflatten correctly.

  • How can I extract the frequency of the FFT function?

    Hi all

    How can I extract the frequency of the FFT function in labview?  Thanks in advance

    Concerning

    If you have the f0 and df, you can find your frequency as you would find the time with a waveform based on t0 and dt.  You just need the index of the data point in that you want to get the frequency.  The frequency is then f0 + x * FD, where x is the index of the data point you are interested in.

Maybe you are looking for