Please help in creating query

I have 3 tables
1. Person table. The columns are PersonID, PersonName and isActive . PersonID is the primary key
2. Vendor Table The columns are VendorID and VendorName. VendorID is the primary key
3. Vendor_Prod table The columns are Ven_prod_id,VendorID, PersonID, MobileNumber. Ven_prod_id is the primary.
I need to find out a query to extract the MobileNumber, PersonName and VendorName where isActive is true
Can anyone help me in writing the query.
Thanks in adavance

You're still missing a join between a and c to ensure you only get back the person records for the vendor_prod you are looking at:
select c.MOBILENumber,b.VENDORNAME,a.PERSONNAME,
from t_person a,
     t_vendor b,
     t_vendor_prod c
where c.PersonID in (select PersonID from t_person where isActive=1)
and c.VENDORID = b.VENDORID
and a.personid = c.personidPerhaps more simply though, now you've had a go yourself, take a look at this..
select vp.mobilenumber, p.personname, v.vendorname
from vendor_prod vp join person p on (p.personid = vp.personid and p.isActive = 1')
                    join vendor v on (v.vendorid = vp.vendorid)or if you don't like ANSI syntax:
select vp.mobilenumber, p.personname, v.vendorname
from vendor_prod vp
    ,person p
    ,vendor v
where p.personid = vp.personid
and   v.vendorid = vp.vendorid
and   p.isActive = 1Note: it's a good idea to use meaningful alias' for your tables rather than just a, b, c... etc.

Similar Messages

  • Please Help for the Query

    Please Help for the Query
    Hi frds please help me for the below query.What I want to do is to pull out the data from below table :-
    date ticker indicator
    03/13/2008 3IINFOTECH -8
    03/18/2008 3IINFOTECH -4
    03/25/2008 3IINFOTECH -5
    03/27/2008 3IINFOTECH -3
    as such :-
    date ticker indicator
    03/13/2008 3IINFOTECH -8
    03/25/2008 3IINFOTECH -5
    03/27/2008 3IINFOTECH -3
    Here I want to find the Trend i.e either asc or desc order from the lowest indicator.
    In the above sample data -8, -4, -5, -3 out of which I want the asc order data -8, -5, -3 and exclude -4 data.Because the asc order -8, -5, -3 will not follow.
    So I want the data
    date ticker indicator
    03/13/2008 3IINFOTECH -8
    03/25/2008 3IINFOTECH -5
    03/27/2008 3IINFOTECH -3

    SQL> CREATE TABLE BORRAME(FECHA DATE, INDICA VARCHAR2(100));
    Tabla creada.
    SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/13/2008','MM/DD/YYYY'), '3IINFOTECH -8');
    1 fila creada.
    SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/18/2008','MM/DD/YYYY'), '3IINFOTECH -4');
    1 fila creada.
    SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/25/2008','MM/DD/YYYY'), '3IINFOTECH -5');
    1 fila creada.
    SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/27/2008','MM/DD/YYYY'), '3IINFOTECH -3');
    1 fila creada.
    SQL> COMMIT;
    Validación terminada.
    SQL>
    SQL> SELECT FECHA, INDICA
      2  FROM BORRAME
      3  WHERE SUBSTR(INDICA,INSTR(INDICA,'-',1)+1,LENGTH(INDICA)) <> '4'
      4  ORDER BY SUBSTR(INDICA,INSTR(INDICA,'-',1)+1,LENGTH(INDICA)) DESC;
    FECHA                                                                
    INDICA                                                               
    13/03/08                                                             
    3IINFOTECH -8                                                        
    25/03/08                                                             
    3IINFOTECH -5                                                        
    27/03/08                                                             
    3IINFOTECH -3                                                        
                    

  • Please help me creating a new listener with different port#.

    I have two instances in a server. both have different homes. I want to create a seperate listener for the second one i created.
    But that is not happening.
    here i tried to give name from LISTENER TO LISTENER1 & Port# from 1521 to 1524.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /apps2/oracle)
    (PROGRAM = extproc)
    LISTENER1 =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = aixth53)(PORT = 1524))
    When I check lsnrctl status with LISTENER1 , it still shows the other instance home with port#: 1521
    Please help me creating a new listener with different port#.
    Thanks,

    marist89 wrote:
    sb92075 wrote:
    marist89 wrote:
    sybrand_b wrote:
    The listener is a broker only and doesn't play any role in normal communications.
    It just forks a process or a thread, and that's it.And the listener is a single point of failure. Listener goes down, you can't connect to the db. That's why you need two listeners.If listener one goes down, then listener two goes down for exact same reason since it is a single executable file.I'm not playing tit-for-tat with you. Fact is, there are situations where people who are not you might want to use more than one listener.Some folks might want to jab a sharp pencil into their eye, too.
    Just because you can do something, it does not necessarily mean it should be done.

  • I created my itunes account YEARS ago!! And I can't remember the answers to my security questions? Because I cannot remember the answers I cannot make purchases in the app store. Please help me create new security questions.

    I created my itunes account YEARS ago!! And I can't remember the answers to my security questions? Because I cannot remember the answers I cannot make purchases in the app store. Please help me create new security questions. Please help me.

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then you can try going to https://appleid.apple.com/and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then see if this user tip helps you get the questions reset :https://discussions.apple.com/docs/DOC-4551
    e.g. you can try contacting iTunes Support :http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing the number for Apple  in your country and ask to talk to the Account Security Team : http://support.apple.com/kb/HE57

  • I can't create rescuse email to change security questions. Please helps me create rescuse email

    I cant create rescuse email to change security questions. Please helps me create rescuse email

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then you can try going to https://appleid.apple.com/and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then see if this user tip helps you get the questions reset :https://discussions.apple.com/docs/DOC-4551
    e.g. you can try contacting iTunes Support :http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing the number for Apple  in your country and ask to talk to the Account Security Team : http://support.apple.com/kb/HE57

  • Please help with a query

    select * from testme;
    NAME VAL
    A 1
    A 2
    A 3
    B 1
    B 2
    B 3
    C 1
    C 2
    I want to get the maximum of name and the maximum of corresponding name's value.
    ie., the answer should be
    Name VAL
    C     2
    Please help me with the query.
    Thnx

    SQL> create table testme
      2  as
      3  select 'A' name, 1 val from dual union all
      4  select 'A', 2 from dual union all
      5  select 'A', 3 from dual union all
      6  select 'B', 1 from dual union all
      7  select 'B', 2 from dual union all
      8  select 'B', 3 from dual union all
      9  select 'C', 1 from dual union all
    10  select 'C', 2 from dual
    11  /
    Tabel is aangemaakt.
    SQL> select max(name) name
      2       , max(val) keep (dense_rank last order by name) val
      3    from testme
      4  /
    NAME VAL
    C      2Regards,
    Rob.

  • Please help with some query

    hello all!
    please, help me again.
    we have a foreign key discrepancy and my task is to create a view which will show the 3 aspects.
    Let's we have 3 schemas: A - good (which means that i will compare WITH A, source)
    B and C are bad (which mean that I will checking this schemas).
    So, i need to obtain:
    1) FK that DO NOT exist in B&C and do exist in A
    2) FK that DO exist in bad schemas (B&C) but DO NOT exist in good schema (A)
    3) FK's that exist in both (A&B, A&C) schemas on the SAME TABLE, have THE SAME CONSTRAINT_NAME but are on the DIFFERENT columns.
    the first and second I seem to be done through the
    select CONSTRAINT_NAME, TABLE_NAME, STATUS from dba_constraints where owner='PRIV_MD' and CONSTRAINT_TYPE='R' and CONSTRAINT_NAME
    2 NOT IN (select CONSTRAINT_NAME from dba_constraints where owner ='MSA_MD'); (to get the second task we just reversing owners in query and subquery)
    query. but the third one is really pain in my back. i have a query:
    SELECT a.column_name, b.column_name FROM dba_cons_columns a, dba_cons_columns b, dba_constraints c, dba_constraints d
    WHERE c.CONSTRAINT_TYPE='R'
    AND a.CONSTRAINT_NAME = b.CONSTRAINT_NAME
    AND a.CONSTRAINT_NAME = c.CONSTRAINT_NAME
    AND b.CONSTRAINT_NAME = d.CONSTRAINT_NAME
    AND a.owner = 'PRIV_MD' AND b.owner = 'MSA_MD';
    which runs hours and returns million of rows with the two columns with the same names... but if i'm adding
    AND a.column_name != a.column_name (i'm not sure it's a correct syntax)
    line it returns "no rows selected"
    please, help me obtain it, i'm fighting already the second day..
    (please, don't be angry, i'm just learning and this is my first task on my work...)

    This is basically just a UNION ALL (the constraint columns from both schemas)
    MINUS what exists in both (the INTERSECTion)
    I made it a little more complicated so you could see in which schema the column is used. You could use exactly the same approach for your questions 1 and 2 also.
    SELECT * FROM
    (SELECT a.column_name,c.constraint_name,'salive' schema_containing
    FROM dba_cons_columns a
    INNER JOIN dba_constraints c ON a.CONSTRAINT_NAME = c.CONSTRAINT_NAME
    WHERE a.owner = 'SALIVE' and c.constraint_type = 'R'
    UNION ALL
    select b.column_name,d.constraint_name,'satest'
    FROM dba_cons_columns b
    INNER JOIN dba_constraints d ON b.CONSTRAINT_NAME = d.CONSTRAINT_NAME
    WHERE d.CONSTRAINT_TYPE='R' AND b.owner = 'SATEST') u
    WHERE NOT EXISTS
    (SELECT *
    FROM
    (SELECT a.column_name,c.constraint_name
    FROM dba_cons_columns a
    INNER JOIN dba_constraints c ON a.CONSTRAINT_NAME = c.CONSTRAINT_NAME
    WHERE a.owner = 'SALIVE' and c.constraint_type = 'R'
    INTERSECT
    select b.column_name,d.constraint_name
    FROM dba_cons_columns b
    INNER JOIN dba_constraints d ON b.CONSTRAINT_NAME = d.CONSTRAINT_NAME
    WHERE d.CONSTRAINT_TYPE='R' AND b.owner = 'SATEST') i
    WHERE u.column_name = i.column_name and u.constraint_name = i.constraint_name)

  • Please help with the query (INSERT RETURNING BULK COLLECT INTO)

    I am trying to write a query inside the C# code where I would insert values into a table in bulk using bind variables. But I also I would like to receive a bulk collection of generated sequence number IDs for the REQUEST_ID. I am trying to use RETURNING REQUEST_ID BULK COLLECT INTO :REQUEST_IDs clause where :REQUEST_IDs is another bind variable
    Here is a full query that use in the C# code
    INSERT INTO REQUESTS_TBL(REQUEST_ID, CID, PROVIDER_ID, PROVIDER_NAME, REQUEST_TYPE_ID, REQUEST_METHOD_ID, SERVICE_START_DT, SERVICE_END_DT, SERVICE_LOCATION_CITY, SERVICE_LOCATION_STATE, BENEFICIARY_FIRST_NAME,
    BENEFICIARY_LAST_NAME, BENEFICIARY_DOB, HICNUM, CCN, CLAIM_RECEIPT_DT, ADMISSION_DT, BILL_TYPE,
    LANGUAGE_ID, CONTRACTOR_ID, PRIORITY_ID, UNIVERSE_DT, REQUEST_DT, BENEFICIARY_M_INITIAL,
    ATTENDING_PROVIDER_NUMBER, BILLING_NPI, BENE_ZIP_CODE, DRG, FINAL_ALLOWED_AMT, STUDY_ID, REFERRING_NPI)
    VALUES
    (SQ_CDCDATA.NEXTVAL, :CIDs, :PROVIDER_IDs, :PROVIDER_NAMEs, :REQUEST_TYPE_IDs,
    :REQUEST_METHOD_IDs, :SERVICE_START_DTs, :SERVICE_END_DTs, :SERVICE_LOCATION_CITYs,
    :SERVICE_LOCATION_STATEs, :BENEFICIARY_FIRST_NAMEs, :BENEFICIARY_LAST_NAMEs, :BENEFICIARY_DOBs,
    :HICNUMs, :CCNs, :CLAIM_RECEIPT_DTs, :ADMISSION_DTs, :BILL_TYPEs, :LANGUAGE_IDs,
    :CONTRACTOR_IDs, :PRIORITY_IDs, :UNIVERSE_DTs, :REQUEST_DTs, :BENEFICIARY_M_INITIALs,
    :ATTENDING_PROVIDER_NUMBERs, :BILLING_NPIs, :BENE_ZIP_CODEs, :DRGs, :FINAL_ALLOWED_AMTs,
    :STUDY_IDs, :REFERRING_NPIs) RETURNING REQUEST_ID BULK COLLECT INTO :REQUEST_IDs
    However, when I run this query, it gives me a strange error ORA-00925: missing INTO keyword. I am not sure what that error means since I am not missing any INTOs
    Please help me resolve this error or I would appreciate a different solution
    Thank you

    You cannot use (and do not want to in this case) the BULK COLLECT.
    create table for_testing
       the_id      number not null primary key,
       some_data   number
    declare
       l_return_value for_testing.the_id%type;
    begin
      4 
       insert into for_testing
          the_id,
          some_data
       values
          1,
          5
       returning the_id into l_return_value;
       dbms_output.put_line('the return values is ' || l_return_value);
    end;
    20  /
    the return values is 1
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.02
    TUBBY_TUBBZ?Is a simple example. In the future, please use the tags to preserve formatting on your code like i have so it remains readable .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Please help on PIOVT query

    Hello everyone,
    Could anyone please help me to figure out this query......
    I have following tables and data
    create table code_ref (
    ref_id    number,
    type_id   number,
    name      varchar2(50));
    insert into code_ref values(100, 1, 'Part One');
    insert into code_ref values(101, 1, 'Part Two');
    insert into code_ref values(120, 1, 'Part Three');
    insert into code_ref values(125, 1, 'Part Four');
    commit;
    create table product(
    product_id   number,
    name         varchar2(50));
    insert into product values(1, 'Product 1');
    insert into product values(2, 'Product 2');
    insert into product values(3, 'Product 3');
    commit;
    create table product_parts(
    product_id   number,
    part_id      number,
    part_desc    varchar2(50));
    insert into product_parts values(1, 100, 'Product 1, Part 1');
    insert into product_parts values(1, 120, 'Product 1, Part 3');
    insert into product_parts values(2, 100, 'Product 1, Part 1');
    insert into product_parts values(2, 101, 'Product 1, Part 2');
    insert into product_parts values(2, 120, 'Product 1, Part 3');
    insert into product_parts values(3, 101, 'Product 1, Part 2');
    commit;I am able to get this output:
    select *
    from (select product_id, part_id from product_parts group by product_id, part_id)
    pivot (count(part_id) for part_id in(100 "Part One", 101 "Part Two", 120 "Part Three", 125 "Part Four"))
    order by product_id;
    PRODUCT_ID   Part One   Part Two Part Three  Part Four
             1          1          0          1          0
             2          1          1          1          0
             3          0          1          0          0However, since the new PART can be added later on, and must be included in above output, how to write this SELECT. I tried "for part_id in (select......)", it did not work :-(
    Thanks in advance!!!

    Hi,
    Sorry, the exact number of columns produced by any query has to be hard-coded into the query itself.
    user489948 wrote:
    ... However, since the new PART can be added later on, and must be included in above output, how to write this SELECT. I tried "for part_id in (select......)", it did not work :-(Using a sub-query there only works if you're getting XML output. The result set will have a single XMLTYPE column, which may contain any number of elements.
    See the following thread for some other work-arounds:
    Re: Report count and sum from many rows into many columns

  • Please help with creating more diverse iweb blog entries

    I have a blog about sports memorabilia that I use iweb for: http://www.hoopography.com. I have come to a road block in creating blog entries. I have two issues:
    1.) I would like to include more than one image for each blog. I tried to just add images and wrap text around when I create the entry in iWeb, but the images do not show up on the homepage where the blog section is located. I'm assuming I need more than one "place holder", but I have not been able to add more than one. Here is an example of another blog that has multiple images for one entry. Essentially, what I am trying to accomplish: http://offysports.blogspot.com/
    2.) I would like to add YouTube videos so that they not only appear in the individual entry, but also on the homepage where the blog section is located (Otherwise, visitors to the site need to click on the entry to even realize the image is a video. I would like readers to be able to play it right on the homepage.). I have tried to use the "YouTube Widget" to add the videos when working on the entry in iWeb, but the video appears as a still image on the homepage's blog section.
    I have some knowledge of iWeb and Macs. I have been using a Mac and iWeb to work on this blog for about 6 months now, but these 2 problems have stumped and constrained me and the blog. Please help!!!!!! Thanks You.

    I tuned the Place holder into a YouTube Video Widget, and it does display on the homepage, but it does not display as a video. It displays as a still image that the reader has to click on to access the entry and then play the video in the entry instead of playing right on the homepage.
    For the multiple images, are you saying that I can only have one placeholder? I do not follow. I want multiple placeholders for multiple images throughout the single entry (ex: http://offysports.blogspot.com/2010/05/2009-10-panini-studio-basketball.html)
    Thanks

  • Please help with tricky query

    I need help with SQL query (if it can be accomplished with query at all).
    I'm going to create a table with structure similar to:
    Article_Name varchar2(30), Author_Name varchar2(30), Position varchar2(2). Position field is basicly position of an article author in the author list, e.g. if there is one author, his/her position is 0, if 2, then 1st author is 0, second is 1, etc.
    Article_Name Author_Name Position
    Outer Space Smith 0
    Outer Space Blake 1
    How can I automate creation of Position, based on number of authors on the fly? Let's say I have original table without Position, but I want to create a new table that will have this information.
    Regards

    If you have an existing table whose structure doesn't tell you what position the author is in, what's the algorithm you'd use to determine who was the first author, the second author, etc? If you issue a select query on a table without providing an "order by" clause, Oracle makes no guarantees about the order in which it retrieves rows.
    As an aside, why would you store position number in a varchar2 field? If it's a number, it ought to be stored as a number.
    Justin

  • Can someone please help me create an interactive feature.

    I am creating a website for a small business using Adobe Dreamweaver CS6 and am trying to create an interactive feature where the text appears once a button is clicked. The interactive feature I am trying to create is on the website: http://www.specialistengineeringplastics.com/products/ where the product name is given and then more details are shown below it once this name has been clicked. I have access to a wide range of Adobe Products including Fireworks, Flash, Illustrator etc. Please help me!

    I am creating a website for a small business using Adobe Dreamweaver CS6 and am trying to create an interactive feature where the text appears once a button is clicked. The interactive feature I am trying to create is on the website: http://www.specialistengineeringplastics.com/products/ where the product name is given and then more details are shown below it once this name has been clicked. I have access to a wide range of Adobe Products including Fireworks, Flash, Illustrator etc. Please help me!

  • Please help me in Query result.

    Hello Friends..
    Need some help .
    I have refreshed one workbook for one sales document , and it is showing me all the data.
    Could you please tell me how can i check all the key figure value , because in Query properties it is restricted to 0.
    Means , if all the Key figure value are 0 , then it will not show that Row in Report .
    I want to see the result of 0 value as well with out changing Query properties.
    Please help me and advice me , how can i do this.
    Regards

    Hi Jain,
    Without changing the query properties it will not be possible to view all values.
    If you want to view with changing the properties of query.
    Youcan do the following steps
    select each attributes right click >restrict->bring back the restricted value->and execute the query.
    all the rows will be dispalyed
    Hope this helps
    Cheers
    Sunil

  • SQL experts please help for a query

    I have following table1.
    What query can give the result as given below, SQL experts please help on this.
    TABLE1
    Event DATETIME
    in 2/JAN/2010
    out 2/JAN/2010
    in 13/JAN/2010
    out 13/JAN/2010
    in 5/JAN/2010
    out 5/JAN/2010
    RESULT REQUIRED FROM THE SQL QUERY
    COL1_IN COL2_OUT
    2/JAN/2010 2/JAN/2010
    13/JAN/2010 13/JAN/2010
    5/JAN/2010 5/JAN/2010

    I tried to help, but this puzzles me.
    Why is this not returning pre-selected set of rows, why it's doing some merge join cartezian ?
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> select * from table1;
    EVENT      DATETIME
    in         2/JAN/2010
    out        2/JAN/2010
    in         13/JAN/2010
    out        13/JAN/2010
    in         5/JAN/2010
    out        5/JAN/2010
    6 rows selected.
    SQL> explain plan for
      2  with a as
    (select datetime from table1 where event='in'),
    b as
    (select datetime from table1 where event='out')
    select  a.datetime COL1_IN ,b.datetime COL2_OUT from a,b ;
    Explained.
    SQL> set wrap off
    SQL> set linesize 200
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 185132177
    | Id  | Operation            | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |        |     9 |   288 |     8   (0)| 00:00:01 |
    |   1 |  MERGE JOIN CARTESIAN|        |     9 |   288 |     8   (0)| 00:00:01 |
    |*  2 |   TABLE ACCESS FULL  | TABLE1 |     3 |    48 |     3   (0)| 00:00:01 |
    |   3 |   BUFFER SORT        |        |     3 |    48 |     5   (0)| 00:00:01 |
    |*  4 |    TABLE ACCESS FULL | TABLE1 |     3 |    48 |     2   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       2 - filter("EVENT"='in')
       4 - filter("EVENT"='out')
    Note
       - dynamic sampling used for this statement
    21 rows selected.
    SQL> with a as
    (select datetime from table1 where event='in'),
    b as
    (select datetime from table1 where event='out')
    select  a.datetime COL1_IN ,b.datetime COL2_OUT from a,b ;
    COL1_IN         COL2_OUT
    2/JAN/2010      2/JAN/2010
    2/JAN/2010      13/JAN/2010
    2/JAN/2010      5/JAN/2010
    13/JAN/2010     2/JAN/2010
    13/JAN/2010     13/JAN/2010
    13/JAN/2010     5/JAN/2010
    5/JAN/2010      2/JAN/2010
    5/JAN/2010      13/JAN/2010
    5/JAN/2010      5/JAN/2010
    9 rows selected.
    SQL>

  • Please help me with query

    Hi All,
    Iam getting follwoing error when i run below query,
    ORA-01719: outer join operator (+) not allowed in operand of OR or IN
    Select /*+RULE*/ lpad(com.comp_year_nr,2,0) || lpad(com.comp_seq_nr,5,0) comp_nr,
    com.comp_complainant,
    com.comp_date,
    mat.mate_desc,
    sorg.name,
    cri.crit_desc,
    mfh.description,
    usr.user_full_name,
    ccs.character_set,
    com.soun_org_code,
    com.mate_code,
    com.supp_org_code,
    com.shor_number,
    com.sush_number_1,
    com.sush_number_2,
    com.sush_number_3,
    com.comp_quant_comp,
    com.comp_claimed_qty,
    decode(com.comp_solv_acc_qa,'N','Open','Y','Closed')
    status,
    su1.sush_number,
    su1.sush_desc,
    su2.sush_number,
    su2.sush_desc,
    su3.sush_number,
    su3.sush_desc,
    sho.shor_number,
    sho.shor_desc,
    com.comp_decision,
    com.comp_return_qty,
    mat.mate_uom,
    com.comp_receipt_date
    from
    supplier_classification sup,
    organisation_classification org,
    material mat,
    complaint com,
    mat_flat_hier_desc mfh,
    users usr,
    company_character_set ccs,
    shortcoming sho,
    sub_shortcoming su1,
    sub_shortcoming su2,
    sub_shortcoming su3,
    criticality cri ,
    organisations sorg
    where
    com.mate_code = mat.mate_code
    and com.mate_org_code = mat.org_code
    and com.supp_org_code = sorg.code
    and com.supp_org_license = sorg.license
    and sorg.code=sup.supp_code(+)
    and sorg.license=sup.supp_license(+)
    and com.soun_org_code = org.org_code
    and com.soun_org_license = org.org_license
    and com.crit_number = cri.crit_number
    and com.comp_complainant = usr.user_name
    and mat.org_code = ccs.company (+)
    and com.deletion_date is null
    and com.sush_number_1 = su1.sush_number (+)
    and com.sush_number_2 = su2.sush_number (+)
    and com.sush_number_3 = su3.sush_number (+)
    and com.mate_code = mfh.mate_code (+)
    and com.mate_org_code = mfh.mate_comp (+)
    and sho.shor_number = com.shor_number
    and com.comp_complainant = ? and com.soun_org_code = ?
    and sup.hier_code = ? and org.hier_code = ?
    and (org.code in (?) or org.parent1 in (?) or org.parent2 in (?)
    or org.parent3 in (?) or org.parent4 in (?) or org.parent5 in (?)
    or org.parent6 in (?) or org.parent7 in (?) )
    order by com.comp_year_nr, com.comp_seq_nr;
    Please help me how to modify the query Iam using oracle 8i version.
    Thanks
    Srini
    Edited by: srinu2 on Dec 6, 2010 2:38 PM

    The message is pretty clear, I would say.
    Without having your database (really old), nor the requirement is hard to comment on how to adjust this query...
    Post your tables, along with some sample data and your requirement - then we might be able to help you. Use tags to preserve the formatting of your code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • How to exclude the debit memo & credit memo out of COPA report (KE30)?

    As captioned, now the current KE30 default transfers all the data from sales orders interfaces (via VA01), such as common sales order, 3rd party drop shipment, credit memo and debit memo etc. Is there any idea to exclude the quantities display in KE3

  • Word and Pdf files with Forms

    Hi, I want to store *.doc and pdf files in database and use them in forms 9i . My customer wants to open,edit and save the files from the database through forms 9i application. Can anyone please help me in process of storing the files into database a

  • Fax screen comes on my screen

    iwas with support on a cartridge problem ,now when i want to print ,I get a FAX screen and i cant print.I went to the printer devises and saw a check mark on the fax printer and not on the other printer i see.how do i change that

  • Tuning a sql with :1, :2...

    SQL was generated by Peoplesoft application: SELECT DISTINCT COMPANY, PAYGROUP, PAY_END_DT, TO_CHAR(PAY_END_DT, 'YYYY-MM-DD'),      OFF_CYCLE, PAGE_NUM, LINE_NUM, SEPCHK, FORM_ID, PAYCHECK_NBR, EMPLID,      NAME FROM PS_ZZ_PAY_CHK_VW WHERE COMPANY LI

  • Bitwise operator: (010|4)

    Executing the following code results in "12". I do not understand why? public class Test {     public static void main(String[] args) {         System.out.println(010|4); }From what I understand, the answer should be 6. What is wrong with my below lo