order by desc or ASC does not work with rownum

SQL> desc offer
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 OFFER_ID                                  NOT NULL NUMBER(14)
 DOMAIN_ID                                          NUMBER(14)
 OFFERDATE                                          TIMESTAMP(0)
 CONTACTPERSON                                      VARCHAR2(36)
 EMAIL                                              VARCHAR2(50)
 TEL                                                VARCHAR2(23)
 CATEGORY                                           NUMBER(2)
 AMOUNT                                             NUMBER(5)
 STATUS                                             NUMBER(2)


SQL> ed
Wrote file afiedt.buf

  1  select to_char(offerdate,'dd-Mon-yyyy'),
  2     offer_id,
  3     amount
  4  from
  5     offer
  6  where
  7     domain_id=1
  8     and amount is not null
  9* order by offerdate desc
SQL> /

TO_CHAR(OFF   OFFER_ID     AMOUNT
----------- ---------- ----------
27-Apr-2010          4         55
26-Apr-2010          5         45
26-Apr-2010          3         50
26-Apr-2010          2         45

/*****These may be Ten thousand rows*****/
When you add a'm rownum < 2 order by asc or desc in my query, then it does not work.
SQL> ed
Wrote file afiedt.buf

  1  select to_char(offerdate,'dd-Mon-yyyy'),
  2     offer_id,
  3     amount
  4  from
  5     offer
  6  where
  7     domain_id=1
  8     and amount is not null
  9  and
 10     rownum<2
 11* order by offerdate desc
SQL> /

TO_CHAR(OFF   OFFER_ID     AMOUNT
----------- ---------- ----------
26-Apr-2010          5         45

SQL> ed
Wrote file afiedt.buf

  1  select to_char(offerdate,'dd-Mon-yyyy'),
  2     offer_id,
  3     amount
  4  from
  5     offer
  6  where
  7     domain_id=1
  8     and amount is not null
  9  and
 10     rownum<2
 11* order by offerdate asc
SQL> /

TO_CHAR(OFF   OFFER_ID     AMOUNT
----------- ---------- ----------
26-Apr-2010          5         45
I just want to display a disc of DB offerDate wise

Thank you in anticipation

Try this

select to_char(offerdate,'dd-Mon-yyyy'),
       offer_id,
       amount
    from(
    select to_char(offerdate,'dd-Mon-yyyy'),
       offer_id,
       amount
    from

       offer
    where
       domain_id=1
       and amount is not null

       order by offerdate asc)
where  rownum<2

Published by: user12984479 on April 27, 2010 04:34

Tags: Database

Similar Questions

  • SortSpec does not work with CRMI

    Hi all

    We have a custom user interface to display the content from the content server and use the below code to retrieve data from the content server. But somehow SortSpec does not work with CRMI. Any pointer?

    DataBinder requestBinder = idcClient.createBinder ();

    requestBinder.putLocal ("IdcService", "GET_SEARCH_RESULTS");

    requestBinder.putLocal ("SortSpec",

    'order by dDocName ASC, dInDate DESC');

    requestBinder.putLocal ("QueryText", queryText);

    DataBinder answer =

    idcClient.sendRequest (idcContext, requestBinder) .getResponseAsBinder ();

    error: oracle.stellent.ridc.protocol.ServiceException: unable to retrieve search results. Has encountered an exception during execution of a query.

    env: Webcenter content 11.1.1.8

    Thank you

    DM

    Hi Olivier,.

    Instead of

    requestBinder.putLocal ("SortSpec",

    'order by dDocName ASC, dInDate DESC');

    Try this:

    requestBinder.putLocal ("SortSpec", "CSA sddDocName, dInDate DESC");

    Test and report the results.

    Thank you

    Srinath

  • New iPhone IS does not work with MAC Mini 10.6.8. Apple support says upgrade your iTunes. Its the wrong color icon. WHAT? iTunes is the last 11.4 for my mac. All my music is on my Mac. Help!

    New iPhone IS does not work with MAC Mini 10.6.8. Apple support says upgrade your iTunes. Its the wrong color icon. WHAT? iTunes is the last 11.4 for my mac. All my music is on my Mac. Help!

    That is right. The requires iTunes 12.3.3 and in order to get it, you will need to update OS X to El Capitan. That's how Apple has created for better or worse, I'm sorry.

  • the joystick does not work with windows 8

    Hello

    I have a problem using the joystick; When I used it with windows 7 it works, but when I tried to use it with windows 8, even if it is detected in windows, it does not work with any of my VIs(labview_2012).is there an issue with labview, or there is a solution to solve this.

    Thank you

    I wrote this VI in order to study how to integrate a Joystick into my LabVIEW code (I called the "Joystick Sampler" VI).  It has two parts - the lowest fact function, "Query Input Devices", an array of devices, their names and the number of Axes, buttons and POV "hat", in a table called "Joystick Info".  Look at this attention first, in pay to the array Index that seems to match your gamepad, when plug you it into a USB port.

    The upper code can enjoy (one of the) Joystick (s) at the rate of 10 Hz, which allows you to test the buttons, axes, etc..  Note that the primary function of "Initialize the Joystick" takes a parameter (default = 0) which corresponds to the Index of Joystick, you have discovered by looking at the table Info Joystick (see previous paragraph) - If your joystick, for example, seems to be at Index = 4, thread has '4' in the function Initialize Joystick.

    BS

  • DeskJet 712c does not work with Win 7

    I recently switched to a new win 7 Home Premium SP1 (64) my old XP computer which worked well with my printer.  The printer does not work with the new OS and the computer.  Even if the computer indicates that the device is functioning normally, the printer will not accept print orders.  Not even the printer print test.  There is no error reports but the system behaves as if the usb is not connected, even though it is.   There were no changes in connectivity before or after installing new software (or trying) trying to get the new computer set up.

    I just found it and tried the wizard of the printer which also implies that the usb is not connected even though it is.

    The compatibility options have done nothing to help.

    Tara,.

    EUREKA!  At the risk of party too early, it seems that I am able to print with my new computer (HP).  Fixed after almost endless hours trying to get my printer to work despite many internet messages saying it could not be done and other giving solutions that didn't work.

    Why o ' why the solution apparently a hidden secret and why the tools did not work?

    In any case, thank you very much.  With all the problems I'm having to migrate to Windows 7, it's a very important achievement.  Thank you, thank you.

    Chuck

  • 128 - GB MicroSD card does not work with the new Clip +.

    My old Clip + (black, 8 GB) was getting very long in the tooth, so I ordered a replacement off Amazon.  As far as I know, it is identical to the old, but a very unpleasant difference is presented - it does not work with the MicroSD card which has been a huge part of why I got a Sansa at all.  He acknowledges, but after a media updated I'm lucky if more than one album appears.  And that's what's so crazy!  You just blow through the update in a few seconds, and when I navigate on the map, there is nothing or a handful of albums random, orphaned.  That's happened?  I updated the new Clip + for the current firmware (as I had done with previous); I made sure to reproduce all the parameters that I would be put in place before--I can't imagine what could be the cause!

    Treats quick closing:

    The card is formatted in FAT32 with the same sector size in storage aboard the player (32 768 bytes).

    A 64 GB card format works even without any problem.

    I tried to update the media in MTP and MSC mode; the problem is the same in both.

    There is ample space for MTABLE. SYS - I have not yet loaded all the music on the Clip + itself.

    Rockbox plays the card without problem, but the sound quality is horrible (at least on this player; I'm sure that other versions sound best), and its interface is a headache.  No thanks.

    HM.  Looks like to run CHKDSK /F on the map the problem resolved!

  • dedicated on microsoft 4000 keyboard back button does not work with firefox

    Hello-

    I have a microsoft 4000 keyboard.

    He dedicated the buttons back and next to the navigation of the browser: http://xahlee.info/kbd/ms_keyboard/i/ms_n4000_keyboard_LED.jpg

    the back button does not work with firefox

    other info: the next button does not work with firefox. buttons next and previous works with IE, tor and chrome. the keyboard shortcut for back in firefox (alt + left arrow) does not work.

    I've tried clearing cache and cookies and start firefox in safe mode.

    advice?

    Hello

    Thanks for posting your query in Microsoft Community.

    I understand you have questions only by using the back button in the Firefox browser.

    But I would like more information on this topic in order to help you.

    (1) the back button worked before with Firefox?

    (2) don't you make changes before this problem?

    According to your description, there is no problem with the material since it works with Internet Explorer and Google Chrome. Previous key does not only work with Firefox. Therefore, I would advice you to check with Firefox and see if that helps, because they have more expertise on products here to help you better.

    Support for Firefox

    https://support.Mozilla.org/en-us/products/Firefox

    Hope this information is useful. Please write us back for assistance.

  • It does not work with macbook air 2008! What should I do?

    It does not work with the macbook air 2008 os x 10.5.8. What should I do?

    What does not work?

    More details please!

  • Why do code grayscaler site image Web does not work with Mozilla Firefox, but it does to another browser?

    I just noticed that my code (in my blog site), which is a regular code that allows the image to transform into its form in grayscale and cast its original color, does not work with the Mozilla Firefox browser. But with other browsers, it works. I hope you can help me with this little problem. Thank you!

    Should I use a CSS rule that is similar to:

    filter: grayscale(100%)
    

    This property is not yet implemented in Firefox. It is supposed to be implemented in Firefox 34, according to https://developer.mozilla.org/en-US/docs/Web/CSS/filter

  • iCloud 5.2.1.69 does not work with Outlook 2016 (16.0.6965.2053)

    I installed the new iCloud (v5.2.1.69) and found that it does not work with Outlook 2016 (16.0.6965.2053). There is no button "Options"... "to"Mail, Contacts, calendars and tasks"(see photo). In addition, the iCloud Outlook add-in does not display in Outlook. I tried to reinstall the Office 365 and iCloud, but nothing has changed.

    I have exactly the same problem with the latest version of iCloud.  I have Outlook 2016 and 10 Windows and when I try to install iCloud there saying "set up" next "Mail, Contacts, calendars and tasks.  I left it for hours and it does not go beyond this point.  Outlook displays the listed add-in but it is not doing anything.  I tried to remove all of the Apple software, and then reinstall iCloud without result. I've deleted and reinstalled MS Office and then tried to reinstall iCloud - once again no luck.

  • keyconfig does not work with FF 24.0. Is there a way?

    I just finished rebuilding my PC from a hard drive format. In doing so, I loaded the last 24.0 FF.
    Part of my essential app is a script used keyconfig causes a single copy to send the source page to the Clipboard, where the script analysis. Unfortunately, keyconfig does not work with FF 24.0.

    Writing for easy copy begins to explain how acting on a combination of keys, rather than the action of the mouse, without the use of keycopy - but then told how he has no need, because it's too much effort, and besides - keyconfig exists and does the job - which, I agree, he used, very well - but it is no more.

    What should do? If there is no other way, can I get a downgrade of FF that works with keyconfig?

    There is a new add-on, key config (note the space), but it does not what keyconfig did.

    The end of the thread main support doesn't mention a major problem in Firefox 24: keyconfig 20110522 - mozillaZine Forums.

    Did you install from source: http://mozilla.dorando.at/keyconfig.xpi

    Is the problem that Firefox won't let you activate keyconfig, but the dialog box opens, or you can activate or extension allows you to create shortcuts but they do not work?

  • Downloaded the new firefox and it told me that it does not work with my software, how do I go back to my old version

    I have a mac 10.5.8 software. I downloaded moxilla firefox 24 and has replaced the old version to download. Then I got a message that firefox 24 does not work with my software. How to bring back the old version?

    Hello patcouse, if you want to stay with you older version of the OS, then firefox 16 is the last version available that will run in this environment. for a download link, please refer to the Firefox no longer works with Mac OS X 10.5 (at the end of the article).

  • The CD/DVD does not work with El Capitan 10.11.5 on Macbook Pro

    Hello everyone, I spent the time to research on the here and the other site on why the CD/DVD does not work with El Capitan 10.11.5 on MacBook Pro mid 2009. This discussion forum has said that he will not work with the El Capitan software. Any idea or suggestion? Back to Marverick or Yosemite? I tried to use SMC reset, restart, recovery and still the same issue.

    I thank in advance.

    ~ Mike

    I have my doubts that the (10.11.5) software is the problem.  Are you sure that the DVD player is simply not defective?  Have you tried to clean the lens?  What is the State of the disc?

    Your best option may be a date at a bar in engineering of the Apple store for a FREE evaluation.

    Ciao.

  • SQLite Manager does not work with the v11. Until make you it easier to go back to older versions or newer versions stop, breaking most of the modules I won't use Firefox

    SQLite Manager does not work with the v11. Until that make it easier to return to older versions or newer versions stop, breaking most of the modules I use FirefoxHow to come back at 10 Firefox?

    Update Firefox 23.0 which published yesterday afternoon.

  • Norton Toolbar does not work with Firefox 17, provided Comcast Norton Security Suite, Win 7.

    I have Norton Security Suite provided by Comcast. Norton Toolbar does not work with Firefox 17.0.1 on my Win 7 machine. I lived all the questions on this topic and did all the steps and when I click on "Add-ons", he always says that the toolbar is not compatible. It works with IE, but I prefer to use Firefox.

    I had the same problem in the past. If you call customer Norton service toll-free they have always helped me start (without charges) when I have updated to a new version of Firefox - seems to happen every time even if I run the updates regularly. Hope that this phone help-Norton support is always very friendly and helpful-just Google their 800 number.

Maybe you are looking for