Help to create a SQL query

I have one query which is giving me employee details like job, name organizaiton.
Also there is one custom table in which I am updating one flag like attribute20 to 'Y' depending upon some condition.
Now I want to make a query like it show only record on those employee whose flag is null.
Now the issue is this that it may be possible that my custom table could not have the record of some employee but i want to show the details of that employee.
Please revert in case you are not getting ....
Regards
RGB

here is the query and I think it work but i am not sure.... Can somebody double check it.
SELECT rownum, a.full_name, a.employee_number, a.doj, a.client, a.org, a.job,
(SUBSTR (POSITION, INSTR (POSITION, '|', 1, 4) + 1)) process,
a.supervisor
FROM xx_xx_v a, xx_supervisor b where a.EMPLOYEE_NUMBER=b.EMPLOYEE_NUMBER(+) and nvl(b.attribute20,0) != 'Y'
Regards
RGB

Similar Messages

  • Need Help with Creating the SQl query

    Hi,
    SQL query gurus...
    INFORMATION:
    I have two table, CURRENT and PREVIOUS.(Table Defs below).
    CURRENT:
    Column1 - CURR_PARENT
    Column2 - CURR_CHILD
    Column3 - CURR_CHILD_ATTRIBUTE 1
    Column4 - CURR_CHILD_ATTRIBUTE 2
    Column5 - CURR_CHILD_ATTRIBUTE 3
    PREVIOUS:
    Column1 - PREV_PARENT
    Column2 - PREV_CHILD
    Column3 - PREV_CHILD_ATTRIBUTE 1
    Column4 - PREV_CHILD_ATTRIBUTE 2
    Column5 - PREV_CHILD_ATTRIBUTE 3
    PROBLEM STATEMENT
    Here the columns 3 to 5 are the attributes of the Child. Lets assume that I have two loads, One Today which goes to the CURRENT table and one yesterday which goes to the PREVIOUS table. Between these two loads there is a CHANGE in the value for Columns either 3/4/5 or all of them(doesnt matter if one or all).
    I want to determine what properties for the child have changed with the help of a MOST efficient SQL query.(PARENT+CHILD is unique key). The Database is ofcourse ORACLE.
    Please help.
    Regards,
    Parag

    Hi,
    The last message was not posted by the same user_name that started the thread.
    Please don't do that: it's confusing.
    Earlier replies give you the information you want, with one row of output (maximum) per row in current_tbl. There may be 1, 2 or 3 changes on a row.
    You just have to unpivot that data to get one row for every change, like this:
    WITH     single_row  AS
         SELECT     c.curr_parent
         ,     c.curr_child
         ,     c.curr_child_attribute1
         ,     c.curr_child_attribute2
         ,     c.curr_child_attribute3
         ,     DECODE (c.curr_child_attribute1, p.prev_child_attribute1, 0, 1) AS diff1
         ,     DECODE (c.curr_child_attribute2, p.prev_child_attribute2, 0, 2) AS diff2
         ,     DECODE (c.curr_child_attribute3, p.prev_child_attribute3, 0, 3) AS diff3
         FROM     current_tbl    c
         JOIN     previous_tbl   p     ON  c.curr_parent     = p.prev_parent
                                AND c.curr_child     = p.prev_child
         WHERE     c.curr_child_attribute1     != p.prev_child_attribute1
         OR     c.curr_child_attribute2     != p.prev_child_attribute2
         OR     c.curr_child_attribute3     != p.prev_child_attribute3
    ,     cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL <= 3
    SELECT     s.curr_parent     AS parent
    ,     s.curr_child     AS child
    ,     CASE     c.n
              WHEN  1  THEN  s.curr_child_attribute1
              WHEN  2  THEN  s.curr_child_attribute2
              WHEN  3  THEN  s.curr_child_attribute3
         END          AS attribute
    ,     c.n          AS attribute_value
    FROM     single_row     s
    JOIN     cntr          c     ON     c.n IN ( s.diff1
                                    , s.diff2
                                    , s.diff3
    ORDER BY  attribute_value
    ,            parent
    ,            child
    ;

  • Creating an SQL Query for Project Custom Fields Values

    Hello:
    I'm currently trying to create an SQL Query to show all of the server's Project Custom Fields Values, along with the modification date.
    So far, I've managed to display correctly all of the data for all of the Projects' text value Custom Fields (those not based on a LookUp Table) with this query:
    SELECT
    MSP_PROJECTS.PROJ_NAME,
    MSP_CUSTOM_FIELDS.MD_PROP_NAME,
    MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE,
    MSP_PROJ_CUSTOM_FIELD_VALUES.TEXT_VALUE,
    MSP_PROJ_CUSTOM_FIELD_VALUES.MOD_DATE
    FROM
    MSP_PROJ_CUSTOM_FIELD_VALUES
    INNER JOIN
    MSP_CUSTOM_FIELDS
    ON MSP_CUSTOM_FIELDS.MD_PROP_UID = MSP_PROJ_CUSTOM_FIELD_VALUES.MD_PROP_UID
    INNER JOIN
    MSP_PROJECTS
    ON MSP_PROJECTS.PROJ_UID = MSP_PROJ_CUSTOM_FIELD_VALUES.PROJ_UID
    WHERE
    MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE IS NULL
    ORDER BY
    MSP_PROJ_CUSTOM_FIELD_VALUES.PROJ_UID,
    MSP_PROJ_CUSTOM_FIELD_VALUES.MD_PROP_UID
    However, when I try a new Query to obtain the actual values for the Projects Custom Fields that do use a LookUp Table, I can't seem to find what table in the model I'm supposed to link to the MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE field (the TEXT_VALUE
    field has NULL value when CODE_VALUE field isn't NULL)
    Any suggestions on how to obtain the actual Projects' custom fields values instead of the Code Value, for Metadata that do use a LookUp Table?
    Also, I'm able to run this query only in the Published Database, since the MSP_CUSTOM_FIELDS table is empy in the Draft Database. Why is that?
    Awaiting your kind reply,
    Sebastián Armas PMO Project Manager

    Hi Sebastián, rather than directly accessing the database it would be better to use the PSI to get this data.  Take a look at the ProjTool sample in the SDK whcih gets this data.
    Best regards,
    Brian.
    Blog |
    Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter |
    Project Developer Center |
    Project Server Help | Project Product Page

  • How to get cm:search to use the max attribute when creating the SQL query?

    When we use the max attribute in the cm:search tag, it does not seem to honor the max attribute when creating the SQL query. However, the result returned from the tag is limited to the number specified by the max attribute. Then the tag seems to work as intended, but the performance will be sub optimal when the SQL query returns unnecessary rows to the application.
    We use the cm:search tag to list the latest news (ordered by date), and with the current implementation we have to expect a decrease in performance over time as more news is published. But we can’t live with that. We need to do the constraint in the SQL query, not in the application.
    The sortBy attribute of cm:search is translated to “order by” in the SQL query, as expected.
    Is it possible to get cm:search to generate the SQL query with an addition of “where rownum <= maxRows”?

    Hi Erik,
    The behavior of a repository in regards to the search tag's max results parameter is dependent on the underlying repository's implementation. That said, the OOTB repository in WLP does augment the generated SQL to limit the number of rows returned from the database. This is done in the parsing logic. This behavior may differ with other repository implementations.
    -Ryan

  • Help needed in framing SQL query.

    Hi,
    I have table having following schema:
    PRODUCT_ID         INT
    DATE                   DATETIME
    ITEMS_SOLD         INT
    This table contains data for a week (sunday to saturday). I want to write an SQL query to get (filter out) PRODUCT_ID of products which has same no. of ITEMS_SOLD for all 7 days. Also for given PRODUCT_ID I need to find the longest period of successive days where the no. of ITEMS_SOLD is same for all days in this period. Eg.(PRODUCT_ID 23 was sold as following along the week in no. of units sold: 4,6,6,6,6,7,4 .So the longest period is *4 days* from Monday to Thursday.) The first condition is special case of second condition where no. of days is 7.
    Any help to get the SQL query will be appreciated.
    Thanks,
    Akshay.

    PRODUCT_ID      DATE           ITEMS_SOLD
    1          10/10/2011     3
    1          11/10/2011     3
    1          12/10/2011     3
    1          13/10/2011     3
    1           16/10/2011     5
    2          10/10/2011     4
    2           11/10/2011     4
    2          12/10/2011     4
    2          13/10/2011     4
    2           14/10/2011     4
    2          15/10/2011     4
    2          16/10/2011     4
    Output:
    PRODUCT_ID ITEMS_SOLD NO_OF_DAYS
    1          3                4     
    2          4               7
    Explanation of results:
    The table to be queried contains data for 1 week: from 10/10/2011(Sunday) to 16/10/2011(Saturday). Now, product with PRODUCT_ID '1' was sold on dates 10,11,12,13,16. Out of these 5 days 3 units were sold on 4 successive days (from 10-13). So output should be like :
    PRODUCT_ID ITEMS_SOLD NO_OF_DAYS
    1          3               4     
    as longest period of successive days is 4 where same no. of units were sold i.e 3 units (other period is of 1 day on 16th ).
    For PRODUCT_ID 2 we have only one period of 7 days where 4 units were sold each day. So we output :
    PRODUCT_ID ITEMS_SOLD NO_OF_DAYS
    2           4               7
    Other case where same PRODUCT_ID have different units sold on each day should be ignored.
    I hope that clarifies the problem more. Let me know in case I have missed out anything which should have been mentioned.
    -Akshay.

  • Help me write a SQL query; urgent

    Hi, can somebody please help me write a SQL query.
    I have 3 tables each with the same column names (Col1, Col2, Col3). Col1 is PK with Unique Constraint.
    I wanted to add values of Col2 and Col3 (from all 3 tables) and put it in a separate table (i.e aggregated) of all values found in Col1.
    Does anybody help me please ?
    thanks alot.

    Please don't mark your question as urgent. You've been around here long enough that you should know that it will not get your question anwered any faster, and may just irritate people into not answering at all.
    I'm not sure exactly what you want.
    Are you saying you want t1.c2 + t1.c3 + t2.c2 + t2.c3+ t3.c2 + t3.c3 for the rows that have the same c1 in all three tables?
    If so, it would be like this, I think: insert into t4
    select t1.c1
    , t1.c2 + t1.c3 + t2.c2 + t2.c3+ t3.c2 + t3.c3
    from t1, t2, t3
    where t2.c1 = t1.c1
    and t3.c1 = t1.c1If that's not what you want, please clarify.
    And next time maybe you should post your SQL question in a SQL forum.

  • Need help in Report From SQL Query

    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    I tried also increase the page time out in httpd.conf, but no use.
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?

    user602513 wrote:
    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    I tried also increase the page time out in httpd.conf, but no use.
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?Do you get any errors or warnings or it is just the slow speed which is the issue?
    There could be a variety of reasons for the delayed processing of this report. That includes parameter settings for that page, cache settings, network configurations, etc.
    - explore best optimization for your query;
    - evaluate portal for best performance configuration; you may follow this note (Doc ID: *438794.1* ) for ideas;
    - third: for that particular page carrying that report, you can use caching wisely. browser cache is neither decent for large files, nor practical. instead, explore the page cache settings that portal provides.
    - also look for various log files (application.log and apache logs) if you are getting any warnings reflecting on some kind of processing halt.
    - and last but not the least: if you happen to bring up a portal report with more than 10000 rows for display then think about the usage of the report. Evaluate whether that report is good/useful for anything?
    HTH
    AMN

  • Help needed in executing SQL query...

    Hi,
    I am very new to JDeveloper. Curently i am tryin to execute an SQL query from the BPEL process, the output of the query is to be mapped to a variable field from a target xsd file. the query is fairly simple, like
    SELECT emp
    FROM emp_table
    WHERE emp_id=123
    The target field, namely "employee", is an element from the xsd file. I tried using Java embedding activity to connect to the db and execute the query through a piece of Java code, but couldn't find a way to assign the output of the query to the field. however lately i also discovered the Database Adapter services which helps me create a database connection, but still i am not sure as of how to handle and map the output of the query to the variable field.
    Can somebody please help me in resolving the issue either through Java Embed activity or Database Adapter services??
    Thanks in advance
    Anjan

    Anjan,
    I suggest you try the [url http://forums.oracle.com/forums/forum.jspa?forumID=212]BPEL Forum
    John

  • Need help in rewriting a sql query

    Can any one please tell me if there is any utility that can help me correcting the sql I have I need to tune the query as its taking lot of time. I want to use some tool that will help me re-formating the query.
    Any help in this regard will be highly appreciated.

    If you think that Oracle SQL Tuning Tools like SQL Tuning Advisor and SQL Access Advisor are not helping.
    You might look into thrid party tools like Quest- SQL Navigator and TOAD.
    But I don't advise this based on the following:
    Re: Oracle Third Party Tools and Oracle Database
    Oracle have enough tools of its own to satisfy the various needs.
    Adith

  • Help with creating a sql file that will capture any database table changes.

    We are in the process of creating DROP/Create tables, and using exp/imp data into the tables (the data is in flat files).
    Our client is bit curious to work with. They do the alterations to their database (change the layout, change the datatype, drops tables) without our knowing. This has created a hell lot of issues with us.
    Is there a way that we can create a sql script which can capture any table changes on the database, so that when the client trys to execute imp batch file, the sql file should first check to see if any changes are made. If made, then it should stop execution and give an error message.
    Any help/suggestions would be highly appreciable.
    Thanks,

    Just to clarify...
    1. DDL commands are like CREATE, DROP, ALTER. (These are different than DML commands - INSERT, UPDATE, DELETE).
    2. The DDL trigger is created at the database level, not on each table. You only need one DDL trigger.
    3. You can choose the DDL commands for which you want the trigger to fire (probably, you'll want CREATE, DROP, ALTER, at a minimum).
    4. The DDL trigger only fires when one of these DDL commands is run.
    Whether you have 50 tables or 50,000 tables is not significant to performance in this context.
    What's signficant is how often you'll be executing the DDL commands on which the trigger is set to fire and whether the DDL commands execute in acceptable time with the trigger in place.

  • Create default sql query in DashBoard Prompt

    Hi,
    I want to set the default value in a DashBoard Prompt to current year with a sql query?
    thnx, Robbert

    You need to create a dashboard prompt and in Default To -> select SQL Results
    Click on the ... (three dots ) underneath it and put in your sql
    For Example , I have a Table called "Sales Date" in my "ABC" presentation folder. This has a column called "Year" and "Date". If I want to have a Year prompt with the default value set to current year, here is what the syntax of my sql result will be :-
    SELECT "ABC"."Sales Date".YEAR
    FROM "ABC"
    WHERE "Date" = current_date
    In SQL, we cannot put SQL as we know of in terms of Oracle, Sql Server etc. The SQL here refers to sql as OBIEE understands it and should be in the form of Select "Presentation foler"."Table Name".ColumnName from "Presentation Folder"
    Hope this helps

  • Problem creating an sql query with a parameter which is a list

    Hi,
    Im having a problem creating a certain SQL query.
    The query looks like this:
    SELECT gstock_id FROM germplasm_stock gps, germplasm gp WHERE gps.germplasm_id = gp.germplasm_id AND organism_id IN ($childList:VARCHAR).
    the organism_id field is of DECIMAL type.
    the parameter childList is actually a list of Id's, something like: 123,124,789
    and it is created dynamically by an other function, so I cant just put it there staticlly.
    I tried using the ARRAY type instead of VARCHAR, but that didn't work,
    anyone knows how can I give this query a parameter which is a list of numbers ?
    Thanks

    I have tried all the following options and the same issue occurs:
    EXEC dbo.uspGetSiteChanges @ChangeVersion = ?
    With Parameter: 0, @ChangeVersion, ChangeVersion
    EXEC dbo.uspGetSiteChanges ?
    With Parameter: 0, @ChangeVersion, ChangeVersion
    In my first data flow I use the following and it works on two OLE DB Sources:
    EXEC dbo.uspGetSiteChanges @ChangeVersion = ?
    With:
    In my second data flow task, I use the same command and parameter mappings and it fails, very strange.

  • Please help me with this SQL query

    I am practicing SQL queries and have come across one involving fetching data from 3 different tables.
    The three tables are as below
    <pre>
    Country
    location_id          country
    loc1          Spain
    loc2          England
    loc3          Spain
    loc4          USA
    loc5          Italy
    loc6          USA
    loc7          USA
    </pre>
    <pre>
    User
    user_id location_id
    u1 loc1
    u2 loc1
    u3 loc2
    u4 loc2
    u5 loc1
    u6 loc3
    </pre>
    <pre>
    Post
    post_id user_id
    p1 u1
    p2 u1
    p3 u2
    p4 u3
    p5 u1
    p6 u2
    </pre>
    I am trying to write an SQL query - for each country of users, display the average number of posts
    I understand the logic behind this that we first need to group together all the locations and then the users belonging to one country and then find the average of their posts.
    But, i'm having a difficulty in putting this in SQL form. Could someone please help me with this query.
    Thanks.

    select
    country.country,
    count(*) Totalpostspercountry,
    count(distinct post.user_id) Totaldistincuserspercountry,
    count(*)/count(distinct post.user_id) Avgpostsperuserbycountry
    from
    country, muser, post
    where country.location_id = muser.location_id
    and muser.user_id = post.user_id
    group by country.country
    The output is like this for your sample data - hope this is what you were looking for :)
    COUNTRY,TOTALPOSTSPERCOUNTRY,TOTALDISTINCUSERSPERCOUNTRY,AVGPOSTSPERUSERBYCOUNTRY
    England,1,1,1,
    Spain,5,2,2.5,

  • Help Reqd - on simple sql query

    Hi,
    I have two tables back_temp_ord_hist, temp_ord_hist of similar structures
    create table <table_name>
    order_number          varchar2(10),
    item_number          integer,
    sched_line_number          integer,
    dlv_doc_id               varchar2(10),
    mtrl_mstr_key          integer,
    cust_key               integer,
    wrhse_key               integer,
    sls_ord_type          varchar2(4)
    Now I have inserted same data set in the two tables. (same following three rows in both the tables)
    0009032022     160          2     0091383073          27219     1694     20 ZISO
    0009032022     160          3     0091383073          27219     1694     20 ZISO
    0009032022     160          4     0091383073          27219     1694     20 ZISO
    Then I am trying to use a query like below :
         select
              fact.order_number
              , fact.item_number
              , fact.sched_line_number
              , bk_fact.sched_line_number          as old_sched_line_number     
              , fact.dlv_doc_id
              ,dbms_utility.get_hash_value(fact.order_number||fact.item_number||fact.sched_line_number||fact.dlv_doc_id,1,100) ord_hist_hash
              ,dbms_utility.get_hash_value(bk_fact.order_number||bk_fact.item_number||bk_fact.sched_line_number||bk_fact.dlv_doc_id,1,100) back_ord_hist_hash
              , fact.mtrl_mstr_key
              , bk_fact.mtrl_mstr_key           as old_mtrl_mstr_key
              , fact.cust_key
              , bk_fact.cust_key                as old_cust_key
              , fact.wrhse_key
              , bk_fact.wrhse_key                as old_wrhse_key     
              , fact.sls_ord_type
              , bk_fact.sls_ord_type                as old_sls_ord_type
         from      
              temp_ord_hist fact
         join
         back_temp_ord_hist bk_fact
                   on fact.order_number = bk_fact.order_number
                   and fact.item_number = bk_fact.item_number
                   and fact.sched_line_number <> bk_fact.sched_line_number
                   and fact.dlv_doc_id = bk_fact.dlv_doc_id
                   order by ord_hist_hash, back_ord_hist_hash
    But it is actually it is showing 6 rows. But ideally I want no rows as temp_ord_hist.sched_line_number = back_temp_ord_hist.sched_line_number in all the cases over here.
    Practically it can be different then I want those rows but when it is same why the output is showing 6 rows.
    What I am doing wrong over here?
    Regards,
    Koushik

    Not sure how you are getting 6 rows as the output. I did exactly the same thing that you did and I am getting the only 3 rows as the output:
    see below:
    SQL> create table temp_ord_hist
    2 (
    3 order_number varchar2(10),
    4 item_number integer,
    5 sched_line_number integer,
    6 dlv_doc_id varchar2(10),
    7 mtrl_mstr_key integer,
    8 cust_key integer,
    9 wrhse_key integer,
    10 sls_ord_type varchar2(4)
    11 );
    Table created.
    SQL> create table back_temp_ord_hist
    2 (
    3 order_number varchar2(10),
    4 item_number integer,
    5 sched_line_number integer,
    6 dlv_doc_id varchar2(10),
    7 mtrl_mstr_key integer,
    8 cust_key integer,
    9 wrhse_key integer,
    10 sls_ord_type varchar2(4)
    11 );
    Table created.
    SQL> insert into temp_ord_hist values ('0009032022',160,2,'0091383073',27219,1694,20,'ZISO');
    1 row created.
    SQL> insert into temp_ord_hist values ('0009032022',160,3,'0091383073',27219,1694,20,'ZISO');
    1 row created.
    SQL>
    SQL> insert into temp_ord_hist values ('0009032022',160,4,'0091383073',27219,1694,20,'ZISO');
    1 row created.
    SQL> insert into back_temp_ord_hist values ('0009032022',160,2,'0091383073',27219,1694,20,'ZISO');
    1 row created.
    SQL> insert into back_temp_ord_hist values ('0009032022',160,3,'0091383073',27219,1694,20,'ZISO');
    1 row created.
    SQL> insert into back_temp_ord_hist values ('0009032022',160,4,'0091383073',27219,1694,20,'ZISO');
    1 row created.
    SQL> select
    2 fact.order_number
    3 , fact.item_number
    4 , fact.sched_line_number
    5 , bk_fact.sched_line_number as old_sched_line_number
    6 , fact.dlv_doc_id
    7 ,dbms_utility.get_hash_value(fact.order_number||fact.item_number||fact.sched_line_number||fact.dlv_doc_id,1,100) ord_hist_hash
    8 ,dbms_utility.get_hash_value(bk_fact.order_number||bk_fact.item_number||bk_fact.sched_line_number||bk_fact.dlv_doc_id,1,100) back_ord_hist_hash
    9 , fact.mtrl_mstr_key
    10 , bk_fact.mtrl_mstr_key as old_mtrl_mstr_key
    11 , fact.cust_key
    12 , bk_fact.cust_key as old_cust_key
    13 , fact.wrhse_key
    14 , bk_fact.wrhse_key as old_wrhse_key
    15 , fact.sls_ord_type
    16 , bk_fact.sls_ord_type as old_sls_ord_type
    17 from
    18 temp_ord_hist fact
    19 join
    20 back_temp_ord_hist bk_fact
    21 on fact.order_number = bk_fact.order_number
    22 and fact.item_number = bk_fact.item_number
    23 and fact.sched_line_number = bk_fact.sched_line_number
    24 and fact.dlv_doc_id = bk_fact.dlv_doc_id
    25 order by ord_hist_hash, back_ord_hist_hash
    26
    SQL> /
    0009032022 160 3 3 0091383073 4 4 27219 27219 1694 1694 20 20 ZISO ZISO
    0009032022 160 4 4 0091383073 55 55 27219 27219 1694 1694 20 20 ZISO ZISO
    0009032022 160 2 2 0091383073 100 100 27219 27219 1694 1694 20 20 ZISO ZISO
    SQL>

  • Help to write following SQL query?

    Hey, beginner hopes to get some help from pro's.
    Please write SQL query to select only green and yellow fruits that are in stock and output results sorted by fruit name in ascending order.
    Database name: warehouse
    Table name: Inventory
    id |   Fruit   | Color | stock
    1 |  apple   | green | 5
    2 | banana | yellow | 3
    3 | orange | orange | 1
    4 | lemon  | yellow  | 7
    5 |  pear   | green 
    | 0
    Thanks in advance!

    If your database and SQL server use default SQL Server collation which is case insensitive, then drop lower function from the suggested script and use 
    color in ('green', 'yellow')
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

Maybe you are looking for

  • Radeon 9800 pro 256mb hanging on blue screen

    I'm deep in the waters of frustration right now, and am hoping someone here might have the answer. About 3 months ago I was looking for a video card for me to run motion. I saw the 9800 mac special edition with 128mb video ram had rave reviews. At th

  • Button is not coming in the first row of a table view

    Hi, I am having an assignment block in which i have added a button in DO_PREPARE_OUTPUT method. It is displaying in the second line in the header of the table view and the first line shows the excel and personalization buttons. I want all these butto

  • Add File Properties/Summary to render in After Effects?

    Is there a way to add file description info to a render in after effects? For instance: I want to render out my sequence as an WMV - set up the render and output settings for that etc. Once it's rendered I want to be able to right click on the file i

  • Web service invokation problem

    Hi, I am having problem when consuming .net web service. This web service expects xmlobject which I create using <cfxml> tag. I have used <cfinvoke> and CreateObject without any success. First I get following error message: java.lang.IllegalArgumentE

  • XSQL support in Oracle Portal?

    What I would like to do is have the client perform a search/query via a Portlet. The Portlet would invoke the XSQL Servlet with an XSQL Page. The XSQL Servlet would do it's thing and return HTML (transformed by using an XSL stylesheet) to the Portlet