Re: Sql result b where condition

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Sql result b where condition
Date: 2010-01-25 12:24:00
Message-ID: 20100125122400.GC5108@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

In response to Matthew Wakeling :
> On Mon, 25 Jan 2010, A. Kretschmer wrote:
> >In response to ramasubramanian :
> >
> >Please, create a new mail for a new topic and don't hijack other
> >threads.
>
> Even more so - this isn't probably the right mailing list for generic sql
> help questions.

ACK.

> >select ENAME,ORIG_SALARY, 1 as my_order from employee where (ename='Tom'
> >and
> >orig_salary=2413) union all select ENAME,ORIG_SALARY, 2 employee where
> >(orig_salary=1234 ) order by my_order.
>
> Or just:
>
> select ENAME,ORIG_SALARY from employee where (ename='Tom' and
> orig_salary=2413)or(orig_salary=1234 ) ORDER BY orig_salary DESC
>
> as there is going to be only two values for orig_salary.

hehe, yes, overseen that fact ;-)

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message fkater@googlemail.com 2010-01-25 14:55:32 Re: Inserting 8MB bytea: just 25% of disk perf used?
Previous Message Matthew Wakeling 2010-01-25 12:10:34 Re: Sql result b where condition