How to display the results in the order based on the value of research

Hi all

How to display the results in the slot order.
 

CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))

INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');

SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0

output: 
SONGID     TITLE
10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
11     CICCONE, MADONNA (CA)
12     DALLIN, MADONNA LOUISE/STOCK
13     MADONNA
14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
15     MADONNA (CA)
16     MIRWAIS AHMADZAI, MADONNA
17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
18     MADONNA (CA),CICCONE

Expected output :
13     MADONNA
14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
15     MADONNA (CA)
18     MADONNA (CA),CICCONE
..
..
..
..
...
If the user makes a search with "MADONNA", I view the results as title begins with "MADONNA" first then the rest of the records.
Please let me know is possible to show the results in this order.


Kind regards
Rajasekhar

This can be a little more specific:

SQL> SELECT *
  2  FROM   TEST
  3  WHERE  INSTR (TITLE, 'MADONNA') > 0
  4  ORDER  BY INSTR (TITLE, 'MADONNA')
  5           ,TITLE
  6  ;

              SONGID TITLE
-------------------- --------------------------------------
                  13 MADONNA
                  14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                  15 MADONNA (CA)
                  18 MADONNA (CA),CICCONE
                  12 DALLIN, MADONNA LOUISE/STOCK
                  11 CICCONE, MADONNA (CA)
                  17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                  16 MIRWAIS AHMADZAI, MADONNA
                  10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)

Tags: Database

Similar Questions

  • How to display the value of the variable for bottom of pl/sql

    How to display the value of the variable for bottom of pl/sql

    declare

    V_1 number: = 10;

    V_2 number: = 20;

    V_3 number: = 30;

    v_4 number: = 40;

    v_5 number: = 50;

    test varchar2 (100);

    Start

    I'm in 1.5

    loop

    test: = "v_" | I have;

    dbms_output.put_line(i||) e > ' | test);

    end loop;

    end;

    /

    How to get below output:

    1 > v_1

    2 > v_2

    3 > v_3

    4 > v_4

    5 > v_5

    But I want to output of

    1 > 10

    2 > 20

    3 > 30

    4 > 40

    5 > 50

    Hello

    You cannot reference variables as you did and get the value of the variable. Use pretty collection.

    set serveroutput on size 2000
    declare
      type      number_table is table of number;
      numbers   number_table := number_table(10, 20, 30, 40, 50);
    begin
      for i in numbers.first .. numbers.last
      loop
        dbms_output.put_line(i || '->' || numbers(i));
      end loop;
    end;
    /
    
    anonymous block completed
    1->10
    2->20
    3->30
    4->40
    5->50
    

    See the Collections of PL/SQL and Records http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#LNPLS005

  • How to display the values of the Parent form in the form of child

    Hello


    I have the order Page and Page element


    In the order Page If I select any item and click submit, it should open the article Page and results should display in advance table region. In my article page I have region of header (default double) with 3 fields (dummy) as

    Agenda
    Description
    org

    Now my question is, I need to display the value of the item in the item Page header area in the column of the item that I was selecting in the order Page.

    I have a prescription 100 point A, B, C, I select B and click on submit it should open on the Articles page and article Page, I have a column called Item and value B sholud be fulfilled.



    Thank you
    Mahesh

    OAMessageTextInputBean oa = (OAMessageTextInputBean) webBean.findChildRecursive ("ItemNo");
    oa.setAttributeValue (SItemNo);

    There is no such method as setAttributeValue for UI beans, this method is for VO, that is to say if you take a VO and VO a method object to set its attribute.

    Bean of the user interface, you will need to use method below,

    OAMessageTextInputBean oa = (OAMessageTextInputBean)webBean.findChildRecursive("ItemNo");
    oa.setValue(pageContext,SItemNo);
    

    Thank you
    AJ

  • How to display the value of the column

    Oracle 10g on Linux

    I want to display the value of the id column in the table of www if count (distinct id) is 1. The following query is fine except that it does not display the value of the column ID help, please.
    SELECT count(distinct id)
                   FROM www c
                  WHERE C.x_code IN (SELECT D.x_code
                                                     FROM www_app d
                                                    WHERE d.y_code = '1151299386')
                  having count(distinct id) = 1                                                

    I think you can use MAX in this case

    SELECT max(id)
                   FROM www c
                  WHERE C.x_code IN (SELECT D.x_code
                                                     FROM www_app d
                                                    WHERE d.y_code = '1151299386')
                  having count(distinct id) = 1
    
  • How to display the values of this query? The type is XDB. XDB$ STRING_LIST_T

    Hi all

    If I run this query using a tool like developer PL/SQL (SQL window), the values are displayed as a Collection. Just click and see the results of the al.

    Select
    dbms_resconfig.getRepositoryResConfigPaths)
    Of
    Double;


    I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).

    How can I do? With the help of the table? Create a type?

    TKS

    user12083350 wrote:

    I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).

    SQL> select * from table(dbms_resconfig.getRepositoryResConfigPaths())
      2  /
    
    COLUMN_VALUE
    --------------------------------------------------------------------------------
    /sys/xs/userrc.xml
    /sys/xs/rolesetrc.xml
    /sys/xs/drolerc.xml
    /sys/xs/rolerc.xml
    /sys/xs/frolerc.xml
    /sys/xs/xdserc.xml
    /sys/xs/scrc.xml
    
    7 rows selected.
    
    SQL> 
    

    And in PL/SQL:

    SQL> declare
      2      v_list xdb$string_list_t := dbms_resconfig.getRepositoryResConfigPaths();
      3  begin
      4      for i in 1..v_list.count loop
      5        dbms_output.put_line(v_list(i));
      6      end loop;
      7  end;
      8  /
    /sys/xs/userrc.xml
    /sys/xs/rolesetrc.xml
    /sys/xs/drolerc.xml
    /sys/xs/rolerc.xml
    /sys/xs/frolerc.xml
    /sys/xs/xdserc.xml
    /sys/xs/scrc.xml
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

    Published by: Solomon Yakobson, April 24, 2010 15:04

  • How to display the value of sys_context in SQL Developer?

    Hello
    I can see the results via sqlplus with the following statements:
    SYS_CONTEXT ('empno_ctx', 'empno_attrib') SELECT Empno_attrib FROM DUAL;
    SELECT * FROM SESSION_CONTEXT;
    the two retrieve correct values;
    now, since I mainly work with SQL Developer I wanted to display the results in here too;
    I ran the procedure in SQL Developer via a right click on the procedure-> run;
    He looked like he ran ok.
    However, when I do the queries above nothing is retrieved;
    any suggestions?
    Thank you
    Rgds

    It may be that the two things are running in different sessions.

    What happens if you run them in a spreadsheet?

    Start
    procedure_call;
    end;
    /
    Select sys_context...

  • How to display the values of the component of the shuttle by defaul in shuttle from left

    Hi, I have created part of shuttle through JDeveloper
    and I put all the properties
    It displays on the page

    There are two boxes or shuttle displayed
    one is for the other for selected values containing all of the values

    but in my case bydefault all values are displayed to the right of the box
    I mean, by default all values are selected

    How can I solve this

    HA,

    First remove the entire list of choices associated with definitions of the bean of the shuttle. The same check if it always throws an error.

    View me lookup definition, attribute, definition drop-down list Attriubute view drop-down list.

    Kind regards
    GYAN

  • How to display the value of the parameter in the xmlp layout

    Hi all

    1.) my rdf report that generates an xml (I m using to create the model of presentation xmlp) file takes some parameters.

    (2) rdf even generates also a PDF file that i'm using a pattern pre-determined XMLP design layout, this PDF shows also the values of the given parameters.

    3.) so that these settings are not available as a block of data or in the XML output.

    My question is how can I display the same settings in my layout xmlp or how can I get the element name for the parameter that are given when running simultaneous program values.


    Thank you
    Pratap

    At the beginning of the report, simply add these

    
    
    
    

    where p_PARAMETER1, p_start_date, and p_end_date are names of param simultaneous pgm
    and refer to them as

    
    
    
    
    
  • How to display the value of parameter of current session

    Hello

    How can a db user know the value of a parameter of the session, if he doen't have the privilege to access the parameters of v$?
    SQL> conn hr/hr
    Connected.
    
    SQL> show parameter QUERY_REWRITE_ENABLED
    ORA-00942: table or view does not exist
    
    SQL> alter session set QUERY_REWRITE_ENABLED=true ;
    Session altered.
    
    ...
    
    -- how can the user HR know the value of QUERY_REWRITE_ENABLED

    ahmedbaraka wrote:
    Hello

    How can a db user know the value of a parameter of the session, if he doen't have the privilege to access the parameters of v$?

    Like this:

    oracle@g5 ~]$ sqlplus scott/scott
    
    SQL*Plus: Release 11.1.0.6.0 - Production on Fri Nov 6 15:38:11 2009
    
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL>
    SQL>
    SQL>
    SQL> show parameter query_rewrite_enabled
    ORA-00942: table or view does not exist
    
    SQL> set serveroutput on
    SQL> DECLARE
      2    parnam VARCHAR2(256);
      3    intval BINARY_INTEGER;
      4    strval VARCHAR2(256);
      5    partyp BINARY_INTEGER;
      6  BEGIN
      7    partyp := dbms_utility.get_parameter_value('query_rewrite_enabled',
      8                                                intval, strval);
      9    dbms_output.put('parameter value is: ');
     10    IF partyp = 1 THEN
     11      dbms_output.put_line(strval);
     12    ELSE
     13      dbms_output.put_line(intval);
     14    END IF;
     15    IF partyp = 1 THEN
     16      dbms_output.put('parameter value length is: ');
     17      dbms_output.put_line(intval);
     18    END IF;
     19    dbms_output.put('parameter type is: ');
     20    IF partyp = 1 THEN
     21      dbms_output.put_line('string');
     22    ELSE
     23      dbms_output.put_line('integer');
     24    END IF;
     25  END;
     26  /
    parameter value is: TRUE
    parameter value length is: 4
    parameter type is: string
    
    PL/SQL procedure successfully completed.
    

    So read the [Function GET_PARAMETER_VALUE | http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_util.htm#sthref7801]

  • How to display the values of sno using the query?

    Hi all
    I use oracle 10g. Could u pls help for sno or count as follows.below is the set of sample data,
    100 JOE 1-JAN-2012 1000
    100 JOE 15-FEB-2012 3000
    200 MAX 1-MAR-2012 5000
    200 MAX 1-APR-2012 5000
    200 MAX 1-MAY-2012 4000
    .... ..... ............... ......
    I need the o/p should be displayed with the County as follows.
    sno eno name   hdate          amt
    1  100   JOE   1-JAN-2012    1000
    2  100   JOE   15-FEB-2012   3000
    1  200   MAX   1-MAR-2012   5000
    2  200   MAX   1-APR-2012   5000
    3  200   MAX   1-MAY-2012   4000
    .. .... ..... ............... ......
    How to reach this sno 1,2,3 for each record? is it possible?. can u suggest me the solution?

    Thank you

    Concerning
    Vids

    Hi vidusnat,

    SQL> with t as (
      2  select 100 eno, 'JOE' name, to_date('1-JAN-2012', 'DD-MON-YYYY') hdate, 1000 amt from dual
      3  union all
      4  select 100 eno, 'JOE' name, to_date('15-FEB-2012', 'DD-MON-YYYY') hdate, 3000 amt from dual
      5  union all
      6  select 200 eno, 'MAX' name, to_date('1-MAR-2012', 'DD-MON-YYYY') hdate, 5000 amt from dual
      7  union all
      8  select 200 eno, 'MAX' name, to_date('15-APR-2012', 'DD-MON-YYYY') hdate, 5000 amt from dual
      9  union all
     10  select 200 eno, 'MAX' name, to_date('15-MAY-2012', 'DD-MON-YYYY') hdate, 4000 amt from dual
     11  )
     12  select row_number() over (partition by t.eno order by t.hdate),t.* from t
     13  ;
    
    SQL> /
    
    ROW_NUMBER()OVER(PARTITIONBYT.ENOORDERBYT.HDATE)        ENO NAM HDATE            AMT
    ------------------------------------------------ ---------- --- --------- ----------
                                                   1        100 JOE 01-JAN-12       1000
                                                   2        100 JOE 15-FEB-12       3000
                                                   1        200 MAX 01-MAR-12       5000
                                                   2        200 MAX 15-APR-12       5000
                                                   3        200 MAX 15-MAY-12       4000
    
    SQL>
    

    Kind regards
    Gennady

  • How to display the value of a javascript variable in a region of html?

    Hello

    I need to show my title of the page or in a region of html.
    I added a script in the < title > section header of style...:
    (Thanks to Andy: page attributes Get page name? )
    <script type="text/javascript">
    var pageTitle = '#TITLE#';
    </script>
    ... so I can use it in a javascript variable.

    But now I don't know how to view in html syntax...

    Thank you!
    Fanny

    ... so I can use it in a javascript variable.

    See no reason to change the templates to introduce a needless global JS variable when the document property is already there. Display using an appropriate HTML element, for example h1 if it's the overall page header.

  • How to display the value in the extra column added to SQL QUARY

    Jin

    I create a report of the region and my

    Select LAB_ID, SALARY, PAYMENT_MONTH, PAYMENT, PAYMENT_MODE, CHECK_NO, CHECK_DATE, BANK_NAME, RECIEVE_AMT, RELEVING_DATE, 'C' from LAB_SALARY_DETAILS where PAYMENT_MONTH =: P47_MONTH and PAYMENT = "ADVANCE".

    in this Quary I add a column more C. I want to show the difference between WAGE RECIEVE_AMT in column C.



    How can I do that.

    Thank you
    Maury

    Here you go...

    select LAB_ID,SALARY,PAYMENT_MONTH,PAYMENT,PAYMENT_MODE,CHECK_NO,
    CHECK_DATE,BANK_NAME,RECIEVE_AMT,RELEVING_DATE,RECIEVE_AMT-SALARY C from LAB_SALARY_DETAILS
    where PAYMENT_MONTH =:P47_MONTH and PAYMENT = 'ADVANCE'
    

    See you soon,.
    Hari

  • How to display the value of an element based on another element

    Hello
    In a page, I have to display name for the corresponding id displayed in id element. I can write a query based on the id and full name as soon as I enter this item.if, so is there any properties that I need? I'm looking for just post_text_item functionality in forms?

    Thank you
    Manoi

    Hello Eric,

    You must alert gReturn instead of get.
    But it is your call to this public page? And Page 0 requires an authorization?

    Greetings,
    Roel

    http://roelhartman.blogspot.com/

  • How to display the VALUE 'DEFAULT' constraint?

    Hello

    I tried to use the user_constraint table and it does not show me the default value for a column in my table. Anyone know the table to the query?

    Thank you.

    Failure of the column is not a constraint. Use the XXX_TAB_COLUMNS view:

    SQL> create table tbl(x number default 999);
    
    Table created.
    
    SQL> select data_default from user_tab_columns where table_name = 'TBL' and column_name = 'X'
      2  /
    
    DATA_DEFAULT
    --------------------------------------------------------------------------------
    999
    
    SQL> 
    

    SY.

  • How to display the value of a column as the title of a report?

    I have a table with two columns: a column has a date, another b column is varchar. Two columns values like this:
    A AND B
    12/03/2012 test1
    22/04/2010 test2
    09/08/2011 test3
    29/07/2011 test1
    01/12/2010 test3
    28/10/2010 test2

    I need to generate a report for A year and count b like this:
    CalendarYear test1 test2 test3 total
    2010-2011 count (test1) count (test2) count (test3) count (test1) + count (test2) + count (test3)
    2011-2012-count (test1) count (test2) count (test3)


    How to get there?
    Thank you.
    Jen

    Published by: Jen Hu on November 1, 2012 11:31

    SQL > select trunc (i, 'year'), count (*), sum (decode(j,'test1',1,0)) test1cnt, sum (decode(j,'test2',1,0)) test2cnt, sum (decode(j,'test3',1,0)) test3cnt
    2 of demo2
    3 Group of trunc (i, 'year');

    TRUNC (I,'Y COUNT (*) TEST1CNT TEST2CNT TEST3CNT)
    ---------- ---------- ---------- ---------- ----------
    01/01/2012 1 1 0 0
    01/01/2010 2 0 1 1
    2011-01-01 2 0 0 1

  • How to display the parameter string registered by DBMS_XMLINDEX?

    This is probably a stupid question, but I can't seem to find any function to display the setting of a parameter string that was recorded by DBMX_XMLINDEX. REGISTERPARAMETER.

    For example,.

    If I have:
    BEGIN
    DBMX_XMLINDEX.REGISTERPARAMETER('indexParam', 'xxxxxxxx');
    END;
    /
    How to display the value of 'indexParam' after creation?
    SQL> set long 1000
    SQL>
    SQL> select paramstr
      2  from xdb.xdb$xidx_param_t
      3  where param_name = 'MYINDEXPARAM'
      4  ;
    
    PARAMSTR
    --------------------------------------------------------------------------------
    PATH TABLE po_ptab
        PATH ID INDEX po_pidx
        ORDER KEY INDEX po_oidx
        VALUE INDEX po_vidx
        PATHS(NAMESPACE MAPPING(xmlns:p="http://www.example.com/IPO"))
        GROUP MASTERGROUP XMLTABLE PO_TAB
        ('/p:PurchaseOrder'
            COLUMNS
               REFERENCE VARCHAR2(30) PATH 'p:Reference',
               REQUESTOR VARCHAR2(30) PATH 'p:Requestor' )
        GROUP ITEMGROUP XMLTABLE ITEMGROUP_TAB
        ('/p:PurchaseOrder/p:LineItems/p:LineItem'
            COLUMNS
               LINENUMBER NUMBER(38) PATH '@p:ItemNumber',
               QUANTITY NUMBER(38) PATH '@p:Quantity',
               DESCRIPTION VARCHAR2(256) PATH 'p:Description')
     
    

    After you add it to an index, you can also view the content in USER_XML_INDEXES. PARAMETERS (XML format).

Maybe you are looking for