order by desc with distinct - Page 2
DBAsupport.com Forums - Powered by vBulletin
Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: order by desc with distinct

  1. #11
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Originally posted by jmodic
    That should probably read:
    Code:
    ... and
          rownum >= 1 )
    ...
    Damn you and your Slovenian sharp eyes. I suppose so.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  2. #12
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by slimdave
    Damn you and your Slovenian sharp eyes. I suppose so.
    I was only returning you the ball - remember not so long ago you spotted a missing double-singe quotes inside the quoted string (hm, should I read/rewrite that agin immediately?) in one of my responses?
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #13
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Originally posted by jmodic
    I was only returning you the ball - remember not so long ago you spotted a missing double-singe quotes inside the quoted string (hm, should I read/rewrite that agin immediately?) in one of my responses?
    Oh yes, I remember that very well indeed.

    Ah, happy days!
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  4. #14
    Join Date
    Jan 2003
    Location
    india
    Posts
    175
    sorry, no luck.
    what i got is...

    1 select*
    2 from
    3 (
    4 select distinct
    5 invoicenumber
    6 from
    7 invoices i
    8 where
    9 hnum='2222222' and
    10 rownum >= 1 )
    11 order by
    12* invoicenumber desc
    SQL>
    SQL> /
    select*
    *
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel

  5. #15
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    What about avoiding explicit DISTINCT and using it implicitly? Something like:
    Code:
    select invoicenumber from invoices
     where hnum='2222222'
    UNION
    select invoicenumber from invoices
     where 1=2
    order by invoicenumber desc;
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  6. #16
    Join Date
    Jan 2003
    Location
    india
    Posts
    175
    oops! it's even worse.

    SQL> select invoicenumber from invoices
    2 where hnum='2222222'
    3 UNION
    4 select invoicenumber from invoices
    5 where 1=2
    6 order by invoicenumber desc;
    select invoicenumber from invoices
    *
    ERROR at line 4:
    ORA-00600: internal error code, arguments: [12451], [], [], [], [], [], [], []

    SQL>

  7. #17
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Well, that's it then -- time to get patching and upgrading. To my own recollection, 8.1.5 sucked.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  8. #18
    Join Date
    Jan 2003
    Location
    india
    Posts
    175
    everybody, thank you for the interest and effort.

    -Raja

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width