Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

'order by' and 'desc' not working in subquery using 'not in'


  • From: pgsql-bugs(at)postgresql(dot)org
  • To: pgsql-bugs(at)postgresql(dot)org
  • Subject: 'order by' and 'desc' not working in subquery using 'not in'
  • Date: Tue, 31 Jul 2001 04:15:49 -0400 (EDT)
  • Message-id: <200107310815.f6V8Fnt52900@hub.org> <text/plain>

Rahul Gade (Rahul_g(at)ip(dot)eth(dot)net) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
'order by' and 'desc' not working in subquery using 'not in'

Long Description
Hello,
 I am facing two big problems,they may not be really big but in my case these are big :
 1) temporary tables can not be created inside function using PL/pgsql
 2) order by and desc keywords are not functioning inside subquery
    
in the following query i am trying to delete all the rows except the top 20 rows from reporttable.
How i can do this.
i have done this in MSSQL using same syntax

Out of these two 2nd problem is important for me,
plase tell me what to do,
                                    --- Thanks for response ----


Sample Code
 delete from reporttable where (srvServerid=serverid) and
(rptreportid not in(select rptreportid from reporttable
where (srvserverid=serverid order by rpttimestamp desc)));

No file was uploaded with this report




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group