by selecting each of the nth order key without using a rank value

Hello

Suppose we have a table of Orders

create table orders)

order_no number primary key,

customer_id number,

item_id number);

insert into orders)

Select 101, 601, 90 of all the double union

Select 103, 602, 100 of all the double union

Select 603, 105, 110 Union double all the

Select 107, 604, 120 Union double all the

Select double union all 108, 605, 130

Select double union all 109, 606, 140

Select 110, 607, 150 Union double all the

Select 111, 608, 160 Union double all the

Select 112, 609, 170 Union double all the

Select 114, 610, 180 doubles);

How can we take every third order_no controlled key order_no without use of rank and connect function using sql.

as

105,

109,

112

can someone please help?

Thank you

Max

How can we choose each third order_no order_no keys without the use of grade -controlled

Reason is?

Anyway, using ROWNUM then:

SQL > select order_no

2 starting at)

3. Select order_no, rownum rn

4 of)

5. Select order_no

6 orders

7 order of order_no

8    )

9)

10 where mod (rn, 3) = 0;

ORDER_NO

----------

105

109

112

Tags: Database

Similar Questions

  • count the number of lines without using the count function

    Hello
    How count the number of lines without using the count function?

    Thank you

    Assuming that your statistics table are updated:

    select num_rows
    from   all_tables
    where  table_name = 'YOUR_TABLE_NAME_IN_UPPERCASE';  
    

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14237/statviews_2105.htm#REFRN20286

  • My iPhone 5 s a problem that the accusation itself decreases without using the phone, I changed the battery it is always the same and I put it in airplane mode it's always the same problem how to solve this help please?

    problem iPhone 5s load is reduced to

    My iPhone 5 s a problem that the accusation itself decreases without using the phone, I changed the battery it is always the same and I put it in airplane mode it's always the same problem how to solve this help please?

    Please help me anyone

  • Manually configure the client 11 essbase (without using the Installer)

    Hi all

    is it possible to install the Essbase 11 client without using the installation program?
    I tried to copy the 'bin' and 'regional settings' directory of an existing facility and put in place the variable of environment ARBORPATH - without success.

    I missed something? Maybe some registry entries? Or is it not possible to manually configure the essbase client?

    Any response would be appreciated.

    See you soon,.
    Martin

    In 11.1.2.x, you can get a separate installer for essbase spread spreadsheet add-in.
    Simply, you can run that as we do in version 9.

  • I get an error. "reboot and select proper boot device or insert boot media in selected boot device and press a key" while using the hard drive.

    Replace drive hard hgst with seagate and when I replaced the hard drive from hgst orignial he says "reboot and select proper boot device or insert boot media in selected boot device and press a key" and when I tried to install OS it does not display the hard drives to install operating system.please help

    Hello

    Check your cable connections. If necessary check with the manufacturer of the motherboard System Support
    and Seagate Support.

    Make sure that settings/settings (BIOS/CMOS) often F2 that you start the computer is configured to start at
    on the CD/DVD first in the boot order.

    Seagate - Support
    http://www.Seagate.com/support/

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • How to use the F1 - F12 keys without fn key?

    I use Envy HP dv6-t7200 with Windows 7 SP1 on it, and I would like to first of all it up to use function keys F1 - F12 without having to press the FN key with him.

    is this possible?

    TNX,

    Dario

    Hello

    Shut down the laptop.  Tap away at the esc you key start Notepad to open the Start Menu.  Select the Bios (usually f10) option, and then change the figure in the document at the following link.

    http://support.HP.com/us-en/document/c02035108

    Kind regards

    DP - K

  • M-30 series: how to set the fast CD keys in use?

    Hi people, I have formatted the hard drive of M - 30 my friend. Everything is very good, except that I can't put the buttons for fast CD use in function (front left). Are there missing drivers?

    Hello

    you installed the Toshiba software utility CD & tools or have you downloaded these files of Toshiba home page?

    AFAIK you need Toshiba, Toshiba easy keys and Toshiba console controls.

    If you have problems again!

    Rudi Bye

  • I want the single update query without using the function.

    I want to update sells_table selling_code field with product_code date product table max.
    In the product table, there are several product_code date wise.

    I did with below charly with the use of the service, but we can do in the query what a single update
    without using the function.

    UPDATE sells_table
    SET selling_code = MAXDATEPRODUCT (ctd_vpk_product_code)
    WHERE NVL(update_product_flag,0) = 0;

    (P_product IN VARCHAR2) RETURN of HVL.maxdateproduct NUMBER FUNCTION to CREATE or REPLACE
    IS
    max_date_product VARCHAR2 (100);
    BEGIN
    BEGIN
    SELECT NVL (TRIM (product_code), 0)
    IN max_date_product
    FROM (SELECT product_code, xref_end_dt)
    PRODUCT
    WHERE TO_NUMBER (p_product) = pr.item_id
    ORDER BY xref_end_dt DESC)
    WHERE ROWNUM = 1; -He'll be back a single line - max date product code
    EXCEPTION
    WHILE OTHERS
    THEN
    RETURN 0;
    END;

    RETURN max_date_product;

    END maxdateproduct;

    Thanks in advance.

    Hello

    Something like that.

    update setlls_table st
            set selling_code =(select nvl(trim(product_code)) from
                                  (select product_code
                                          , rank() over (partition by item_id order by xref_end_dt DESC) rn
                                       from product
                                   ) pr
                                   where rn =1
                                         and pr.item_id = st.ctd_vpk_product_code
                               ) where NVL(update_product_flag,0) = 0 ;
    

    That such is not tested due to lack of sampling input.

    Concerning
    Anurag Tibrewal.

  • How to restart the Satellite 5200 801 without using the recovery disk?

    Hello
    I haven't used my Satellite 5200 801 for awhile and now it does not start. That's what I have on the black screen:

    Intel® Boot Agent Version 4.1.04
    Copyright © 1997-2002, Intel Corporation
    PXE - E61: Media test failure, check cable of
    PXE - M0F: Exit Intel Boot Agent.
    Insert system disk in drive.
    Press a key when tready.

    I have the product recovery disc, but which will erase all existing data and rebuild. Is there a way to boot my PC without the use of the recovery disk?

    Thanks for any help.

    > PXE - E61: Media test failure, check cable of

    This message means that laptop tried to boot from LAN.
    Given that this was not possible the PXE - E61: Media test failure, check cable appeared

    I guess that the HARD drive is defect and therefore, the laptop won't boot from the internal HARD drive.
    In this case also your internal data on the HARD disk are lost.

    But to be100% sure that you can remove the laptop HARD drive, could use a drive enclosure HARD 2.5 to connect the HARD drive to another computer just to check if you would be able to access data on the HARD drive

  • How to view the line of columns without using the pivot keyword

    Hello
    could someone help me how to display lines in columns without using the keyword pivot and actuall is my scenario, iam having two tables with names and examples of data is shown below

    MIDDLE MINAME TASKID TASKNAME IDENTIFICATION PROJECT

    1 PROJ1 1 AA 100 PR1_TASK1
    1 PROJ1 3 CC PR1_TASK3 102
    1 PROJ1 DD 4 103 PR1_TASK4
    1 PROJ1 EE 5 104 PR1_TASK5
    1 PROJ1 6 105 FF PR1_TASK6
    2 PROJ2 EE 5 114 PR2_TASK1
    2 PROJ2 6 115 FF PR2_TASK2
    2 PROJ2 GG 7 116 PR2_TASK3
    2 PROJ2 HH 8 117 PR2_TASK4
    2 PROJ2 9 118 PR2_TASK5 JJ
    2 PROJ2 KK 10 119 PR2_TASK6
    2 PROJ2 1 AA PR2_TASK7 120


    The output should show the project and County of tasks at a given stage as shown below

    project AA BB CC DD EE FF GG HH JJ KK
    1 2 0 1 5 3 2 0 2 1 0
    2 1 2 0 2 1 0 2 4 3 1


    Thanks in advance,
    VVR
    CREATE TABLE pivot_test (
    ID           NUMBER,
    PROJECT      VARCHAR2(10),
    MID          NUMBER,
    MINAME       VARCHAR2(5),
    TASKID       NUMBER,
    TASKNAME     VARCHAR2(10)
    );
    
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 1,  'AA', 100, 'PR1_TASK1');
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 3,  'CC', 102, 'PR1_TASK3');
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 4,  'DD', 103, 'PR1_TASK4');
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 5,  'EE', 104, 'PR1_TASK5');
    INSERT INTO pivot_test VALUES (1, 'PROJ1', 6,  'FF', 105, 'PR1_TASK6');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 5,  'EE', 114, 'PR2_TASK1');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 6,  'FF', 115, 'PR2_TASK2');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 7,  'GG', 116, 'PR2_TASK3');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 8,  'HH', 117, 'PR2_TASK4');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 9,  'JJ', 118, 'PR2_TASK5');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 10, 'KK', 119, 'PR2_TASK6');
    INSERT INTO pivot_test VALUES (2, 'PROJ2', 1,  'AA', 120, 'PR2_TASK7');
    
    SELECT ID as PROJECT,
           SUM(DECODE(miname, 'AA', 1, 0)) AS AA,
           SUM(DECODE(miname, 'BB', 1, 0)) AS BB,
           SUM(DECODE(miname, 'CC', 1, 0)) AS CC,
           SUM(DECODE(miname, 'DD', 1, 0)) AS DD,
           SUM(DECODE(miname, 'EE', 1, 0)) AS EE,
           SUM(DECODE(miname, 'FF', 1, 0)) AS FF,
           SUM(DECODE(miname, 'GG', 1, 0)) AS GG,
           SUM(DECODE(miname, 'HH', 1, 0)) AS HH,
           SUM(DECODE(miname, 'JJ', 1, 0)) AS JJ,
           SUM(DECODE(miname, 'KK', 1, 0)) AS KK
    FROM   pivot_test
    GROUP BY ID;
    
    PROJECT AA BB CC DD EE FF GG HH JJ KK
    ------- -- -- -- -- -- -- -- -- -- --
          1  1  0  1  1  1  1  0  0  0  0
          2  1  0  0  0  1  1  1  1  1  1 
    
  • Problems with Vista after disconnecting external USB key without using 'remove hardware safely '.

    A week ago, I unplugged my external Seagate USB drive without using a 'Remove hardware safely' first of my Vista pc.  Since reconnecting the drive, I had a series of problems.  The drive itself seems to be ok.   I am able to read and write to files on the disk.  I'm not able to do is the following:

    (1) open disk management.  It hangs on "Connecting to Virtual Disk Service".

    (2) stopping or starting without windows to snap or take an extra long time to stop or start.

    (3) failed to start Google Picasa3 or Adoble Photoshop Elements 7.  They both hang him.  I am able to use other programs such as Microsoft Office, Outlook, Miro, Norton Antivirus.

    Points 1 and 2 above work fine if the drive is not connected.  I plugged the drive into another computer (Windows 7) and ran Seagate disk checking utility.  He came clean back (no bad sectors) so that the drive is NOT corrupted.  (Check of the Seagate utility disk hung on my pc Vista.)   It seems that something related to the disk under Vista service is corrupted.

    I also see "driver has detected an error in the controller on \Device\Harddisk2\DR2." event message for different devices.  I also tried a restore to a point just before that the problem occurred.

    I don't want to reinstall Vista therefore looking for a solution.  Thank you.

    Janis

    Hello

    You can see the two links below, try the given suggestion and check if this helps you solve the problem.

    http://social.technet.Microsoft.com/forums/en/windowsserver2008r2management/thread/8b5d2c5b-C212-4E3F-96e3-91e668d3b178

    http://social.answers.Microsoft.com/forums/en-us/w7hardware/thread/b2b29ed8-f620-4FE1-93b5-8ced0d472aeb

    Hope this information is useful.

    Amrita M

    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • LOV value to present the field order LOV/text multi by return value!

    I have nested LOV and return the value reduced to another text/LOV field in good order.

    My problem,
    The text field or return value LOV must be dispay with one by an order of values by (dynamic) .the I using the query in each source LOV.
      select DMS_DD_ENG_DESC dis, DMS_DD_ID ret from DMS_DEPT_DETAILS 
    where DMS_DD_DT_REF_ID=:P3_DETAILS
    
    Workspace          :RAM_R&D
    User Name/Password :aramani/apex
    App                http://apex.oracle.com/pls/apex/f?p=36167:3
    I do dynamic action for this case?

    can someone help me please.
    Thank you
    RAM

    Hi Ram,

    I changed your application and I think it works as desired.
    I don't know if it exactly what you need, but take a look and let me know.

    Kind regards
    Kees Vlek
    -----
    Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66

    If the answer to question please change replied and mark the appropriate post as correct / helpful.

  • How the list order of transactions of older rank 3 months

    Hello world

    I have this problem.

    I have this table

    IDCOUNT (*)MAX (TRANSACTION_DATE)
    1000125.02.2015 14:28:46.635000
    1000125.02.2015 13:56:21.717000
    1000124.02.2015 13:17:56.358000
    950124.02.2015 15:07:05.274000
    950120.01.2015 10:26:29.192000
    2015118.12.2014 20:20:44.609000
    2015104.11.2014 10:36:10.487000
    2015123.10.2014 15:17:10.728000

    I would like to list what ID and the last Transaction_date who made operations older then 2 months.

    Another way, I need to know what ID is not doing transactions on the past 2 moths and when it was his last tranaction

    I'm waiting for the results that

    2015104.12.2014 10:36:10.487000

    Can you help me?

    Thanks in advance

    Rgds

    Carlos

    HI, Carlos.

    okKarol wrote:

    Hello world

    I have this problem.

    I have this table

    ID COUNT (*) MAX (TRANSACTION_DATE)
    1000 1 25.02.2015 14:28:46.635000
    1000 1 25.02.2015 13:56:21.717000
    1000 1 24.02.2015 13:17:56.358000
    950 1 24.02.2015 15:07:05.274000
    950 1 20.01.2015 10:26:29.192000
    2015 1 18.12.2014 20:20:44.609000
    2015 1 04.11.2014 10:36:10.487000
    2015 1 23.10.2014 15:17:10.728000

    I would like to list what ID and the last Transaction_date who made operations older then 2 months.

    Another way, I need to know what ID is not doing transactions on the past 2 moths and when it was his last tranaction

    I'm waiting for the results that

    2015 1 04.12.2014 10:36:10.487000

    Can you help me?

    Thanks in advance

    Rgds

    Carlos

    You don't really have columns named 'COUNT (*)', and ' MAX (TRANSACTION_DATE), do you think?  I'm guessing just what your table really is.

    Here's a way to do what you asked:

    SELECT id

    MAX (NTC) DUNGEON (DENSE_RANK LAST ORDER BY transaction_date)

    AS last_cnt

    MAX (transaction_date) AS last_transactin_date

    FROM table_x

    GROUP BY id

    HAVING MAX (transaction_date)< add_months="" (="" sysdate ="" --="" or="" trunc="">

    - 3

    )

    ;

    If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.

    A WHERE clause would keep a few lines for an identifier given and exclude others.  This isn't what you want.  You want to exclude or include all of the group, not just the lines; It's that the HAVING clause.  HAVING is similar to a different WHERE clause, but it is applied when GROUP BY is finished, and once the aggregate (such as MAX) functions are calculated.

  • Select and delete the elements of an array using mouse events

    Hello

    I am trying to write a code that allows the user to select or remove items from a table to a table in another table. IE, choose what files will be used in later analysis. Selection work ok (using the mouse to select from the table 'files available'), but my deletion section requires an extra mouse click before you update the "trial to use the chart", which causes a lag.

    I really don't see why two events are handled differently in what concerns updating the 'trial to use the table.

    Help, please!

    Thank you

    Graham

    Graham,

    Add an event to the event of value case changed the Stop button. Use it to stop the loop. The way in which your VI is set up two events are necessary after you press Stop until the loop stops. Turn on execution highlighting, and watch what happens to see why.

    In addition, the mechanical Action typical for the stop buttons is latch when released.

    Why not use a ListBox to tests available with SelectionMode is set to 0 or more items? Its output is an array of indexes of names of point.

    Lynn

  • Can I use the dreamspark product key without download windows 8?

    Hi, I had dream spark account recently. I intend to install windows 8.
    I saw a video tutorial on this topic. It shows that this product key appears before the download is complete.
    so, if I get a DVD of windows 8 and use these product keys to install windows 8 of these DVDs without having to download, it'll work?

    Windows 8 provided by DreamSpark is a retail license, so you can use it with a DVD retail or:

    You can download it from there and use your product key to upgrade:

    http://Windows.Microsoft.com/en-GB/Windows-8/upgrade-product-key-only

Maybe you are looking for