How to select a line in the middle of a recordset?

UserID answered QuestionID

10 9 N
10 8 N
10-7 N
10 6 N
10 5
10 4 Y
10 1


In the table sorted by QuestionID DESC, how can I select the first row from the bottom up with answer equals 'n'?

In the example above would be:

10 6 N

I need to select that line and get the value of equal to 6 QuestionID.

Right now I have:

Select QuestionID
of tblMap
When answered = ' don't
and ROWNUM = 1
order by QuestionID CSA;

This always tidy most of the top, that would be:

10 9 N

by reversing the sort in a sorted query under such as rownum 1 is the record of interest:

select userid, questionid, answered
  from (select userid, questionid, answered
          from tblMap
         where answered='N'
         order by questionid ASC)
 where rownum=1

USERID                 QUESTIONID             ANSWERED
---------------------- ---------------------- --------
10                     6                      N        

1 rows selected

Published by: Sentinel July 8, 2009 13:53

Tags: Database

Similar Questions

  • HP Pavilion Notebook 14-n271tx: a vertical line in the middle of my screen

    Hey there, I would like to know more about the vertical line in the middle of the screen of my laptop. There will be a white vertical line in the middle of my screen sometimes but when I adjust the position of my laptop, it disappears. Can I know why is it happening? Is it because of problems in the system or what? How can I solve this problem? What I send to HP customer Service to solve this problem?

    Hi @DustMidnight85

    Welcome to the HP Forums!

    This is a wonderful place to find answers and information!

    You have the best experience in the HP forum, I would like to draw your attention to the Guide of the HP Forums Learn how Post and more

    I understand that you have a problem with the display, but if you change the position of the screen, it disappears.

    Here is a link to the display quality problems that can help.

    As you said it disappears when you reposition the screen, that the connection cable can become loose or damaged opening and closing the display.

    Here is a link to laptop HP Pavilion 14, HP Pavilion 14 Touchsmart laptop, HP Pavilion 14 Touchsmart Ultrabook, maintenance and Service of Guide. Chapter 4 page 36 has removal instructions that can help you check for this problem.

    If your laptop is under warranty or you wish to help please contact HP support for assistance.

    Please contact our technical support at 800-474-6836. If you do not live in the United States / Canada region, please click on the link below to get a number of assistance for your region.

    World wide phone holder

    Good luck!

  • my printer is copying with a black line in the middle of the page

    My printer has just started the copy with a black line in the middle of the page.  Any ideas what the problem is and how to fix it?

    I have a Photosmart C7280 all-in-one printer.  Thank you!

    This document should help:

    Scan quality

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • Selection of lines with the range Paging VO

    Hello

    JDev 11.1.2.4

    I created a VO based on an OA. I added a transitional attribute in the original Version, this attribute is named Selelected of type Boolean initialized to false (default value Expression: false-Expression of Refresh value: false). That VO appears as an af:table. The attribute is displayed as selectBooleanCheckbox. The VO is set with an access mode of range Paging and a size of 28.

    < af:selectBooleanCheckbox value = "#{row.bindings.Selected.inputValue} '"

    label = "#{bindings." VwRhdPortfolioTranWrkSend11.hints.Selected.label}.

    required = "#{bindings." VwRhdPortfolioTranWrkSend11.hints.Selected.mandatory}.

    shortDesc = "#{bindings." VwRhdPortfolioTranWrkSend11.hints.Selected.tooltip}"id ="it1' autoSubmit = 'true '.

    valueChangeListener = "#{pageFlowScope.portfolioTransferBean.onWorkSelection}" >

    < f: validator binding="#{row.bindings.Selected.validator}"/ >

    < / af:selectBooleanCheckbox >

    The table shows the 25 lines. The user clicks one of the checkbox to select a line. The valueChangeListener is called with the new value (auto submit = true) as expected. Then the user scroll down for another "page" in the table, new lines are displayed. Then it scrolls to the first page. The previous selected checkbox is reset as not selected. The selection is lost.

    Is this expected behavior? If so how do you get a selection of lines with a VO of range paging.

    Thank you

    Try to create the transitional attribute in OT instead of VO.

    See you soon

    AJ

  • How to animate a line with the pen tool to give the impression that it is plotted?

    How to animate a line with the pen tool to give the impression that it is plotted?

    Or you can choose the pen tool (g), set the padding to zero and the race to what you want, then draw a path, then press U twice to reveal all of the properties that have been changed for the layer, and then click Add (top-right) and select Connect the tracks.

    To make the race work just animate the start or end point and sent to paint on original or reveal original or normal.

  • The line in the middle of a container

    This horizontal line is supposed to be in the middle of a container:

         <s:Line xFrom="0" 
                   xTo="100"
                   yFrom="{this.width * .5}"
                   yTo="{this.width *.5}">
              <s:stroke>
                   <s:SolidColorStroke weight="8" />
              </s:stroke>
         </s:Line>
    

    But yFrom and yTo are set to 0 and are not being updated by linking.

    The line is set in the skin of the component.

    How can I draw a line in the middle of a container?

    I'm sure it's related to how traits are measured on a GraphicElement.

    See this post for an explanation:

    http://flexponential.com/2010/03/14/measuring-a-GraphicElement-with-a-stroke-in-a-group/

  • NB 550 d - 11 d - horizontal line in the middle of my screen

    I have a toshiba NB 550 d - 11 d a few weeks ago.
    It has been very slow since the beginning.

    Then, the fan has started to be marketed all the time and now I see a horizontal line in the middle of my screen.

    Is that what I can do before I apply for coverage?

    Thank you
    ISA

    Hello

    I fear that the problem is related to a hardware problem m.
    The internal display is affected or the graphics chip on the motherboard is faulty.
    In both cases the hardware must be replaced
    Therefore, you should get in touch with a partner service is available in your country for this problem
    I hope that your warranty is valid

    Good luck

  • How to select multiple cells at the same time?

    Hello

    How to select multiple cells at the same time? What is the keyboard shortcut?

    Thank you to.

    Flo, a french guy.

    Hold down the CMD key when you select the cells.

  • document feeder prints a black line down the Middle

    document feeder prints a black line in the middle of the page

    Yes, the warranty is still valid! I bought the extended warranty for the replacement. So I guess I will contact HP for a new printer.

    Thank you very much for your help!

    Ted

  • I'm getting a vertical line in the middle of the page when I use the ADF on my Officejet Pro 8500 a but

    HP Officejet Pro 8500

    Windows XP

    No error message

    No changes to the system

    Scan using the ADF puts a vertical line in the middle of the scanned page.  This does not happen when I scan from the flat screen

    Brian, this is going to be a pretty easy fix. What you're going to need to get is a lint cloth (as a microfibre cloth or a filter coffee) and get just a wet touch. Then, open the top of your printer to reveal the glass. There are two sections, one large, and that is a thin strip of glass on the left side. If the line makes its appearance in the ADF scans/copies only - clean this thin section with a moist, lint cloth.

    This should help you!

    More information here: https://www.youtube.com/watch?v=SPdwUKnrDgM

    Let me know and have a great day!

  • How to add multiple lines when the button is clicked

    How to add multiple lines when the click on button now is just add a row .plz give me idea how... waiting for answer

    / public final class screen extends MyScreen
    {
    /**
    * Creates a new object of MyScreen
    */
    ObjectChoiceField obj1 obj2, obj3, obj4.
    Table of String() = {'101 ', ' 102'};
    String of shadow [] = {"Shade1", "Shade2"};
    Rolls of string [] = {'101 ', ' 102'};
    String cutting [] = {"100-150", "150-200"};
    Chain of selectedindex1, selectedindex2, selectedindex3, selectedindex4;
    LabelField lbl1 lbl2, lbl3, lbl4;
        
    GFM LinedGridFieldManager;
    HFM HorizontalFieldManager, hfm1, hfm2 hfm3;
    VerticalFieldManager vfmMain;
        
    public MyScreen()
    {
        
    Set the displayed title of the screen
    hfm1 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm2 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm3 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    HFM = new HorizontalFieldManager (HorizontalFieldManager.FIELD_RIGHT);
    vfmMain = new VerticalFieldManager (Manager.NO_VERTICAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLLBAR);
            
    obj1 = new ObjectChoiceField ("", graph, 0, FIELD_LEFT);
    obj2 = new ObjectChoiceField ("", blind, 0, FIELD_LEFT);
    Obj3 = new ObjectChoiceField ("", rolls, 0, FIELD_LEFT);
    Obj4 = new ObjectChoiceField ("", cuts, 0, FIELD_LEFT);
            
    LBL1 = new LabelField("");
    LBL2 = new LabelField("");
    lbl3 = new LabelField("");
    lbl4 = new LabelField("");
            
    ButtonField btnAdd = new ButtonField ("ADD", FIELD_RIGHT);
            
    GFM = new LinedGridFieldManager (4, LinedGridFieldManager.VERTICAL_SCROLL);
            
    hfm1.setMargin (20, 0, 10, 0);
    hfm1. Add (new LabelField ("Chart"));
    hfm1. Add (obj1);
    hfm1. Add (new LabelField ("Shade"));
    hfm1. Add (obj2);
            
    hfm2. Add (new LabelField ("Rolls"));
    hfm2. Add (Obj3);
    hfm2. Add (new LabelField ("Cuts"));
    hfm2. Add (Obj4);
    HFM. Add (btnAdd);
            
    GFM. Add (new LabelField ("Chart"));
    GFM. Add (new LabelField ("Shade"));
    GFM. Add (new LabelField ("Rolls"));
    GFM. Add (new LabelField ("Cuts"));
            
    vfmMain.add (hfm1);
    vfmMain.add (hfm2);
    vfmMain.add (hfm3);
    vfmMain.add (hfm);
    vfmMain.add (new SeparatorField());
    vfmMain.add (gfm);
    Add (vfmMain);
            
    btnAdd.setChangeListener (new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];
                    
    While (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }
    }
    });
    }
    }

    Hi Piya,

    I run your code, and according to your logic that it works correctly.

    It's adding that line only once because according to your logic that one line can be added to MDT, if you do not want to add line on each click on the button, follow these steps:

    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];

    Lbl1 LabelField = new LabelField("");
    Lbl2 LabelField = new LabelField("");
    LabelField lbl3 = new LabelField("");
    LabelField lbl4 = new LabelField("");
    If (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }

  • How to select multiple messages in the messaging application in Windows RT?

    How to select multiple messages in the messaging application in Windows RT?

    For contact:

    1) press the first mail

    (2) then drag the 2nd mail left or right a little bit.

    Repeat 2) for all other mails you want to select. You can use the same way to deselect.

    For the mouse:

    Use the ctrl and shift keys, like the Windows desktop version

    I don't know if there is a way to make the selection of the beach of 'shift' by touch only.

  • How do a straight line of the curve?

    Hello

    I wonder how to move a line to the right a little bit without erasing anything.  How can I move on a bit?  The area that surrounds it may curve a little with it.

    Thank you

    Looks like you could had to use liquefy to move the line, or deformation of the puppet or perspective distortion. Several ways to edit an image and it is difficult to say without seeing a screen shot.

  • Where was this black line down the Middle come from?

    I have a black line in the middle of each page of a template that is visible in the PDF Export. Since it is a magazine model, is it supposed to be there?

    THX.

    Paul

    It's probably the edge of the page. When Acrobat poster towing pages you have the choice of a ditch or a black line between.

Maybe you are looking for

  • Lenovo Y50 + Windows 10 video = Scheduler internal error BSOD

    I'm on Windows 10 now and meet the BSOD every two days. The system is Lenovo Y50 UHD with 860 Nvidia graphics card. I arrived at random while web browing. I think that it is related to the builtin graphics card driver LENOVO MUST provide. A driver fr

  • Boot PXE T430 problems

    First off I would like to list my hardware/software MDT/WDS server: MDT 2012 Windows 2008 R2 server I have a fully working MDT PXE server with a WDS images. Basically, I have a Server TDS who gets the PXE request and then stops on the WDS image to st

  • New motherboard fitted number no. CT

    HelloHave installed a new Intel motherboard, replace an AMD Board in a DV7. After a lot of trouble finding what heatsink and CPU equipped motherboard Intel because the part number was not on HP part surfer I always get the message at the start of inv

  • trying to validate XP with WGAplugin gives error 80070003

    Windows genuine advantage When I try to validate my windows xp pro with WGAplugin Installer, it says the Installation failed. Cannot copy files(Error: 0x80070003)

  • How can I get windows live messenger to start with windows live mail?

    I have to manually start messenger in the start menu whenever I start Windows live mail.  I don't want to run at startup. Thank you, Rudy