One Query, Two Datasources

Is there a way to run a query on two separate datasources? I
would like to compare the data in two separate MS Access databases.
Thanks.

You won't be able to combine two datasources in one cfquery,
so one way might be for you to query each datasource, then compare
the two results using a Q-of-Q.
Phil

Similar Messages

  • One query two different Group By

    In My parameter two option one and two.
    if i select one, need to come this group by:-
    GROUP BY
    Name1,
    Name2,
    Country,
    MCC || '/' | MNC
    One Output:
    Name1 -  Name2 - Country  - PNR
    if i select two, need to come this group by
    GROUP BY
    Name1,
    Country,
    MCC || '/' | MNC
    two output :
    Name1 - Country - PNR
    I have only one sql query But i have two different group by
    Please advise me, m not using subreport option.
    whether any formulas or any other options for group by.

    Try inserting the groups statically that are common for both the parameaters like this
    GROUP BY
    Name1,
    Country,
    MCC || '/' | MNC
    and now create a formula like this
    whilereadingrecords;
    if =1 then
    {Name2 field}
    else
    Now insert one more group using this formula and move the group to second level by using group options.
    Hope this helps!
    Raghavendra

  • One infosource two datasources

    Hi Friends,
    I have the following task.
    I have two data sources, one with actual data and one with planning data.
    Now I want to create an infocube with both the actual and the planning data and one or two aditional fields for the difference
    between actual and planning data.
    I have created the data sources, I have created on infocube with all the fileds from the two datasources.
    When I have created two transformation from datasouces to infosource and one from infosource to the infocube.
    But when I want to create the DTP for the infocube, it asks me to choose between the two datasources.
    How can I go on with it.
    Is there a docu how to handle two datasources, one infosource and one infocube or how else can I do it?
    Thanks in advance.
    RG. Jimbob

    Hi Jim,
    If i am getting you correctly , you need to create one cube with Actual key Figure and Planned Key Figure so that you can calculate the variance.
    In this case, i would suggest you to not add value type in the cube. ( Just have it till the info source).Then write a routine for Actua Key Figure and Planned Key Figure.
    i.e IF VTYPE = 10 populate actuals else populate planned key figure.
    As in any situation if u have value type info object in cube, you will always get tw records in the cube based on value type, even if all other characteristics are same.
    In the scenario where 2 records are generated, if u run a report without dragging value type , it will aggregate both the records as you are expecting.
    Hope this solves your problem.
    Thanks,
    Vikram

  • Oracle Reports : one query - two reports?

    Help, please, Oracle Reports 10g.
    I have a query, need to make two reports in one. They are similar, just couple parameters are different, say, entreprise type and region;
    How do I display these two reports in one? I tried to make parameters as placeholders, package variables, put an trigger on outer frames for reports. parameters do change their values but just the same report displays twice. where is the trick?
    Thank you

    The way I have done this in the past was to create 2 master frames, 1 for each report and then put conditions on each frame as to when it is to appear. Hope this helps..

  • One query, two diffrent outputs

    Hiho,
    i have got a ABC - Analysis in the business partner data. there are 2 related fields. U-umsatz (for total sales) and U_gruppe (for the kind of business partner). Related from this both udf u should get an A, B or C.
    The udt is a matrix with relations between sales and kind of bp.
    I wrote this query
    SELECT TOP 1 T0.[U_Klasse] FROM [@KUNDENKLASSE]  T0 WHERE T0.[U_Umsatz] < $[OCRD.U_umsatz] AND T0.[U_gruppe] = $[OCRD.U_Klasse] ORDER BY T0.[U_Klasse]
    Sometimes i got the correct output, sometimes not. I thought i could be the thousend sep., but it wasnt.
    any ideas ?
    regards

    ok, so the problem is formating of thousand (I hope you have space as separator). Try it as
    SELECT TOP 1 T0.U_Klasse FROM dbo.@KUNDENKLASSE T0 WHERE
    convert(numeric(9,6), replace(convert(varchar(100), coalesce(T0.U_Umsatz, 0)), ' ', ''))
    <
    convert(numeric(9,6), replace(convert(varchar(100), coalesce($http://OCRD.U_umsatz, 0)), ' ', ''))
      AND T0.U_gruppe = $http://OCRD.U_Klasse ORDER BY T0.U_Klasse

  • Using one query two times

    Hi i have a system that control car acidents ..
    I have a query that return the streets from a choosed city, and after i ask if the crash happens in streets crossings,
    So i get the variable $street
    If so i do the same query to return the same streets to the user choose the street crossing.
    So i get the variable $street_crossing
    I only need assign diferent variables names to handle the street and the street crossing.
    Is there any way to not go to the database to do the same work that already is done? and get the previous query result ? i am using php and oracle
    thanks in advance

    After the query, the street list is in $results_crzmt_logr. You
    should be able to print this array twice. The first time with
    headings for "Street" and the second time for "Street Crossing".
    For performance reasons the query may benefit from a bind variable.
    Something like:
        $cmdstr_crzmt_logr = "SELECT NOME, ".
        "B, ".
        "CEP, ".
        "FROM TABLE ".
        "WHERE MUNIC=:mun ".
        "ORDER BY NOME ASC";
        $parsed_crzmt_logr = ociparse($db_conn, $cmdstr_crzmt_logr);
        OCIBindByName($parsed_crzmt_logr, ":mun", $_POST[MUN_CODIGO], 10);
        ociexecute($parsed_crzmt_logr);
        $nrows_crzmt_logr = ocifetchstatement($parsed_crzmt_logr, $results_crzmt_logr);Adding error checking may be useful. The free statement should be:
        OCIFreeStatement($parsed_crzmt_logr);-- CJ

  • Update SAME column name in two tables from ONE query

    Dear All Seniors
    Please tell me is it possible to update a same column name in two tables.
    I have two tables in same schema
    (1)table name
    pem.igp_parent
    column name
    igp_no.
    igp_type
    (2)table name
    pem.igp_child
    column name
    igp_no.
    igp_type
    i want to update igp_no column in one query please tell me how it would be possible.
    thanks
    yassen

    You want to update the data from what to what? Where is the new data coming from?
    If you are trying to put the same data in two different tables, that strongly implies that you have a normalization problem that needs to be addressed.
    Why do you want a single query rather than updating each table in turn? Can you join the two target tables to produce a key-preserved view?
    Justin

  • How can i write two ?DDL in one query

    how can i write two ?DDL statment in one query?

    Issuing two DDL statements requires two edxecutions. Getting around it is possible by creating a procedure that issues the two DDL statements. But they would still have to be issues one at a time, but you would only have to write one statement to invoke it.

  • Make one query of two queries?

    I have these two quries, how can I at the best way get the same result in one query?
    --Querie 1
    SELECT 'm' || Year_Month As Month,
    Sum(NET_SALES) As "Net Sales"
    FROM tlbInfo 
    WHERE Year_Month Between '200709' And '200801'
    And record_type IN ('A','X')
    Group by Year_Month
    Order by Year_Month
    --Querie 2
    SELECT 'm' || Year_Month As Month, 
    Sum(STANDARD_MANUF_COST)/Sum(Case When SALES_QUANTITY <> '0' Then SALES_QUANTITY End) As "Cost",
    to_char(100*((sum(NET_SALES)-sum(STANDARD_MANUF_COST))/sum(NET_SALES)) || '%') As "Margin"
    FROM tlbInfo 
    WHERE Year_Month Between '200709' And '200801'
    And record_type NOT IN ('A', 'X')
    And Net_Sales >0
    Group by Year_Month
    Order by Year_Month

    why did you change the 1st query? now you're further from getting the correct answer (not to mention that now my previous post makes no sense).
    put the 1st query back to the way it was. then change the 2nd query to remove the record_type and net_sales criteria from the where clause, and instead put the logic into the select, via a CASE, like the first query is written.
    now look at the two new queries, and ask yourself, what's so hard about making one query?
    and don't do this work in the original post. do it in notepad. and if you want to post the new queries here to get further help, hit the REPLY button, NOT THE EDIT BUTTON

  • Two Datasources pointing to one connection pool...

    Hi All,
    I have heard you should not have two datasources pointing to one connection pool that each datasource should have it's own pool. What type problems would occur if you did that in WLS 8.1? I heard in 9.2 and above you are not allowed to do that and I suspect it is because of some issue doing many (datasources) to one (connection pool).
    Any comments about this?
    Thanks,
    -Tony

    Hi Hector
    Could you refer the SCN & SAP links
    SAP WEB Dispatcher and DMZ
    Access SAP Webgui and Portal Through Internet Using Web dispatcher
    https://help.sap.com/saphelp_nwce10/helpdata/en/48/8fe37933114e6fe10000000a421937/frameset.htm
    SAP Web Dispatcher - SAP Library
    BR
    SS

  • Two different results using one query

    Hi Friends
    Oracle version that I am using is : Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    I have a scenario where one account can be related to two customers. Hence, in table have many rows for one account. Here’s the sample data:
    Account_ID | product_code | cust_id | relationship_code | entity_code
    1111 | ABC | 1234 | SOL | CUST
    1111 | ABC | 2222 | ZZZ | LINK
    1111 | ABC | 4455 | ABC | LINK
    2222 | ABC | 7890 | SOL | CUST
    2222 | ABC | 5678 | ZZZ | LINK
    3333 | JFK | 5878 | TST | CUST
    3333 | JFK | 3254 | PRI | CUST
    3333 | JFK | 3299 | PRI | CUST
    4444 | JFK | 2535 | SOL | CUST
    4444 | JFK | 4565 | SOL | CUST
    5555 | DEF | 6666 | PRI | CUST
    5555 | DEF | 6667 | TST | CUST
    5555 | DEF | 9667 | TST | CUSTIn this scenario, I need two outputs differently:
    Output 1: When an account has relationship_code = ‘SOL’ then take the least cust_id
    1111 | ABC | 1234 | SOL | CUST
    2222 | ABC | 5678 | ZZZ | LINK
    4444 | JFK | 2535 | SOL | CUST Output 2: else take the highest cust_id
    3333 | JFK | 5878 | TST | CUST
    5555 | DEF | 9667 | TST | CUSTHow can I get this result using one query?

    Not sure what you mean. Works OK:
    SQL> with t as (
      2             select 1111 account_ID,'ABC' product_code,1234 cust_id,'SOL' relationship_code,'CUST' entity_code from dual union all
      3             select 1111,'ABC',2222,'ZZZ','LINK' from dual union all
      4             select 1111,'ABC',4455,'ABC','LINK' from dual union all
      5             select 2222,'ABC',7890,'SOL','CUST' from dual union all
      6             select 2222,'ABC',5678,'ZZZ','LINK' from dual union all
      7             select 3333,'JFK',5878,'TST','CUST' from dual union all
      8             select 3333,'JFK',3254,'PRI','CUST' from dual union all
      9             select 3333,'JFK',3299,'PRI','CUST' from dual union all
    10             select 4444,'JFK',2535,'SOL','CUST' from dual union all
    11             select 4444,'JFK',4565,'SOL','CUST' from dual union all
    12             select 5555,'DEF',6666,'PRI','CUST' from dual union all
    13             select 5555,'DEF',6667,'TST','CUST' from dual union all
    14             select 5555,'DEF',9667,'TST','CUST' from dual union all
    15             select 6666,'XYZ',8877,'SOL','CUST' from dual
    16            )
    17  select  account_ID,
    18          product_code,
    19          cust_id,
    20          relationship_code,
    21          entity_code
    22    from  (
    23           select  account_ID,
    24                   product_code,
    25                   cust_id,
    26                   relationship_code,
    27                   entity_code,
    28                   case max(case relationship_code when 'SOL' then 1 else 0 end) over(partition by account_ID)
    29                     when 1 then dense_rank() over(partition by account_ID order by cust_id)
    30                     else dense_rank() over(partition by account_ID order by cust_id desc)
    31                   end rnk
    32             from  t
    33          )
    34    where rnk = 1
    35  /
    ACCOUNT_ID PRO    CUST_ID REL ENTI
          1111 ABC       1234 SOL CUST
          2222 ABC       5678 ZZZ LINK
          3333 JFK       5878 TST CUST
          4444 JFK       2535 SOL CUST
          5555 DEF       9667 TST CUST
          6666 XYZ       8877 SOL CUST
    6 rows selected.
    SQL> SY.

  • How can update two rows in one query?

    How can update two rows in one query?
    Edited by: OracleM on May 4, 2009 12:16 AM

    What do you mean with "two rows"? May be two columns??
    If the where clause of UPDATE query matches two rows, then it will update two rows. If you want to update two columns, then add column names to your query
    UPDATE your_table SET col1=value1, col2=value2 WHERE your_where_clause- - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Two Lookup on One Query

    Can we use Lookup function twice in one query ??
    Cause in the Log file, I only see the last lookup query.
    Or Any Suggesion for this case ?
    Here's the sample :
    *SELECT(%PRMFGList%,"[ID]","PROCESS","SFG_Pos='P'")
    *XDIM_MEMBERSET PROCESS = %PRMFGList%
    *LOOKUP FINANCE
    *DIM SalesQty:OTHERS = PROCESS.SFG
    *DIM SalesQty:TPDTLS = TPDTLS.ID
    *DIM SalesQty:TPYEARS = TPYEARS.ID
    *DIM SalesQty:CATEGORY = CATEGORY.ID
    *DIM SalesQty:TIME = TIME.ID
    *ENDLOOKUP
    *LOOKUP FINANCE
    *DIM LotSize:OTHERS = PROCESS.SFG
    *DIM LotSize:TPDTLS = TPDTLS.ID
    *DIM LotSize:TPYEARS = TPYEARS.ID
    *DIM LotSize:CATEGORY = CATEGORY.ID
    *DIM LotSize:TIME = TIME.ID
    *ENDLOOKUP
    *WHEN Account.ID
    *IS "Qty"
          *REC(FACTOR=-(LOOKUP(SalesQty)/LOOKUP(LotSize)),ACCOUNT=QtyRMUsage)
    *ENDWHEN
    *COMMIT

    Hi Ari,
    I've faced the same problem, and never found a solution that allowed for 2 lookups. I believe that only one is supported (although I never saw this confirmed in any documentation). With that limitation in mind, you need to choose your LOOKUP carefully, and then use an expanded source data region to load in whatever else you need in your calc. For whatever you can't LOOKUP, you'll need to GET.
    In that case, consider using xdim_noscan to only process the records you want. This helps get around the single LOOKUP limitation.
    In your example here, however, it looks like you can get both of these values in a single lookup. It's not clear to me what differentiates the SalesQty and LotSize (they seem to be the same thing), but I'll assume these are two members in your Account dimension.
    Also, note that if you're not re-directing a particular dimension to a different member, you can just omit it from the LOOKUP. This would apply to your TPDTLS, TPYEARS, CATEGORY, and TIME, if I read your code correctly.
    In that case, you could do this:
    *SELECT(%PRMFGList%,"ID","PROCESS","SFG_Pos='P'")
    *XDIM_MEMBERSET PROCESS = %PRMFGList%
    // this may make the logic run faster
    *XDIM_MEMBER Account = Qty
    *LOOKUP FINANCE
    *DIM SalesQty:Account = SalesQty
    *DIM SalesQty:OTHERS = PROCESS.SFG
    *DIM LotSize:Account = LotSize
    *DIM LotSize:OTHERS = PROCESS.SFG
    *ENDLOOKUP
    *WHEN Account.ID
    *IS "Qty"
    // or possibly you can just use *When *     *is *
    *REC(FACTOR=-(LOOKUP(SalesQty)/LOOKUP(LotSize)),ACCOUNT=QtyRMUsage)
    *ENDWHEN
    *COMMIT

  • Combine values from two records in one query

    Hello.
    Is it possible to combine two record - only one column value?
    With one query we get these results:
    A____B____C____D____E_______F_______G______H
    +++++++++++++++++++++++++++++++++++++++++
    28___84___P___16____________1____02.06.09___1
    28___84___p___8_____________1____02.06.09___1
    28___84___S___16____________1____02.06.09___1
    28___84___T___12____________1____02.06.09___1
    28___84___1___137___________1____02.06.09___1
    28___84___5___18___66,42____1____02.06.09____1
    28___84___6___14____________1____02.06.09___1
    28___84___8___17___214,2____1____02.06.09___1
    If there is a record with column C value 'p', then column value 'D' should be added to record with C value 'P' and 'S': result should be like this:
    No 'p' record and values (D column) for 'P' and 'S' should be a summed by 8 from record 'p'.
    A____B____C____D____E_______F_______G______H
    +++++++++++++++++++++++++++++++++++++++++
    28___84___P___24____________1____02.06.09___1
    28___84___S___24____________1____02.06.09___1
    28___84___T___12____________1____02.06.09___1
    28___84___1___137___________1____02.06.09___1
    28___84___5___18___66,42____1____02.06.09____1
    28___84___6___14____________1____02.06.09___1
    28___84___8___17___214,2____1____02.06.09___1
    And this should be restricted to column A value.
    Any idea?
    Thanks.
    Edited by: DejanH on Jun 2, 2009 11:39 AM

    OK, that's a messy requirement, here's one for 'p' but no 'P' (and 't' but no 'T'), and you can expand that for others yourself.
    WITH test_data AS (
    SELECT 28 A, 84 B, 'p' C, 8 D, NULL E, 1 F, TO_DATE('02.06.09','DD.MM.YY') G, 1 H FROM DUAL UNION ALL
    SELECT 28 A, 84 B, 'S' C, 16 D, NULL E, 1 F, TO_DATE('02.06.09','DD.MM.YY') G, 1 H FROM DUAL UNION ALL
    SELECT 28 A, 84 B, 'T' C, 12 D, NULL E, 1 F, TO_DATE('02.06.09','DD.MM.YY') G, 1 H FROM DUAL UNION ALL
    SELECT 28 A, 84 B, '1' C, 137 D, NULL E, 1 F, TO_DATE('02.06.09','DD.MM.YY') G, 1 H FROM DUAL UNION ALL
    SELECT 28 A, 84 B, '5' C, 18 D, 66.42 E, 1 F, TO_DATE('02.06.09','DD.MM.YY') G, 1 H FROM DUAL UNION ALL
    SELECT 28 A, 84 B, '6' C, 14 D, NULL E, 1 F, TO_DATE('02.06.09','DD.MM.YY') G, 1 H FROM DUAL UNION ALL
    SELECT 28 A, 84 B, '8' C, 17 D, 214.2 E, 1 F, TO_DATE('02.06.09','DD.MM.YY') G, 1 H FROM DUAL)
    -- end test data
    SELECT td1.A, td1.B, td1.C,
         CASE WHEN td1.C IN ('P', 'S') THEN NVL(td1.D,0) + NVL(td2.D, 0) ELSE td1.D END D,
         TO_CHAR(td1.E * 100, 'fm99990,09') E, td1.F, td1.G, td1.H
       FROM test_data td1
       LEFT JOIN (
      SELECT A, SUM(D) D
         FROM test_data
        WHERE C= 'p'
        GROUP BY A) td2
        ON (td1.A = td2.A)
    WHERE C != 'p'
    GROUP BY td1.A, td1.B, td1.C, CASE WHEN td1.C IN ('P', 'S') THEN NVL(td1.D,0) + NVL(td2.D, 0) ELSE td1.D END, TO_CHAR(td1.E * 100, 'fm99990,09'), td1.F, td1.G, td1.H
    UNION
    SELECT td1.A, td1.B, UPPER(td1.C) C,
         SUM(td1.D) D,
         TO_CHAR(td1.E * 100, 'fm99990,09') E, td1.F, td1.G, td1.H
       FROM test_data td1
      WHERE td1.C in ('p', 't')
    GROUP BY td1.A, td1.B, UPPER(td1.C),TO_CHAR(td1.E * 100, 'fm99990,09'), td1.F, td1.G, td1.H
    ORDER BY 1
             A          B C          D E                  F G                  H
            28         84 1        137                    1 02-JUN-09          1
            28         84 5         18 66,42              1 02-JUN-09          1
            28         84 6         14                    1 02-JUN-09          1
            28         84 8         17 214,20             1 02-JUN-09          1
            28         84 P          8                    1 02-JUN-09          1
            28         84 S         24                    1 02-JUN-09          1
            28         84 T         12                    1 02-JUN-09          1
    7 rows selected.

  • Make one query from two

    Hi,
    Could you help optmize this query. If possibel.
    I have three tables: GROUP, GROUP_X_USER, USER.
    If there is a relation between GROUP and USER, it will be stores at GROUP_X_USER.
    Example:
    <tt>
    GROUP               GROUP_X_USER         USER
    1 - GROUP A             1 - 2            1 - MARIO
    2 - GROUP B             1 - 3            2 - JOSE
    3 - GROUP C             2 - 2            3 - MARIA
    </tt>
    That means: JOSE can access groups A and B. MARIA, just group A. MARIO does not
    have a implicit realation, so he can access all groups (A,B and C).
    Clear?
    So... I want to create a sql query that return the groups a given user can
    access. If in my where clause i use "WHERE USER_ID = 2", it should return 2
    lines: GROUP A and GROUP B.
    For users that has a impliciti relation at GROUP_X_USER is a peace of cake query.
    SELECT GROUP.NAME FROM GROUP, GROUP_X_USER, USER
    WHERE GROUP.GROUP_ID = GROUP_X_USER.GROUP_ID
    AND GROUP_X_USER.USER_ID = 2;But, this query does not work for user MARIO.
    Currently, I´m doing this:
    SELECT count(*) INTO wcount FROM GROUP_X_USER WHERE USER_ID = 1;
    if wcount = 0 then
        SELECT GROUP.NAME FROM GROUP;
    else
        SELECT GROUP.NAME FROM GROUP, GROUP_X_USER, USER
         WHERE GROUP.GROUP_ID = GROUP_X_USER.GROUP_ID
           AND GROUP_X_USER.USER_ID = 2;
    end if;
    Can I do this with just one query, whithout need do a count and a "if"?
    PS: My query is actually more complex than this, has 5 tables and a lot of "conditions".
    I made this example just to explain what I need. The goal is to have just one query
    to mantein, because, today, if it needs to change, I need to do it two times.
    Edited by: mcardia on 30/03/2010 12:15
    Edited by: mcardia on 30/03/2010 12:16

    Clear?Sorry, but
    No,since:
    1) you forgot to mention your database version (the result of select * from v$version; )
    2) you've posted unformatted code, which you can (and should) easily adjust by adding the tag before and after your examples.
        see: http://forums.oracle.com/forums/help.jspa for more explanation regarding using tags (scroll a bit down)
        we have no clue regarding columns and/or datatypes you're using now.
    3) please try to put up a small but concisive testcase, using CREATE TABLE and INSERT INTO statements and the results you want from
        that.
    Can I do this with just one query, whithout need do a count and a "if"?
    It probably can be done, but you'd need to be more clear and specific first regarding the already mentioned points.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • As3 TypeError:#2007 Parameter text must be non-null can't fix.

    I have comment box project. As3+php based project.And have #2007 Error.Try to fix but can't do anything.If can help it would be very helpful.Error part like this: TypeError: Error #2007: Parameter text must be non-null. at flash.text::TextField/set t

  • Book Module Export PDF Quality Poor - any solutions?

    Hello, I am trying to figure out a solid solution / workflow for making PDF porfolio's for clients. The commercial studio where I work needs to send pdf portfolio's to potential clients quite often. So far we have not been able to find a perfect solu

  • WVC54GCA. Seutp utility can't locate camera on network

    I just bought the camera today.  Went through each step of the setup.  When I connect the camera, blue light flashes and then becomes steady.  But then I get a message that says "The setup utility was unabel to locate the wireless-g internet home mon

  • Photomerge CS5 doesn't work

    Just try the Photoshop CS5 Trial after working with the CS3 ver. When I try to merge images with the photomerge workflow, it seems that everything working just fine, but after the processing bar shows that the photomerge finished - nothings happen. T

  • Analytic function for grouping?

    Hello @all 10gR2 Is it possible to use an analytic function for grouping following (example-)query: SELECT job, ename, sal,   ROW_NUMBER() OVER(PARTITION BY job ORDER BY empno) AS no,   RANK() OVER(PARTITION BY job ORDER BY NULL) AS JobNo   FROM emp;