Sql result b where condition

From: "ramasubramanian" <ramasubramanian(dot)g(at)renaissance-it(dot)com>
To: <pgsql-performance(at)postgresql(dot)org>
Cc: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Subject: Sql result b where condition
Date: 2010-01-25 09:36:25
Message-ID: C4A7A9FD054F4922BF24B03489A3F2FE@ramasubramanian
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi all,
I have a table emp. using where condition can i get the result
prioritized.
Take the example below.

select ENAME,ORIG_SALARY from employee where (ename='Tom' and
orig_salary=2413)or(orig_salary=1234 )

if the fist condition(ename='Tom' and orig_salary=2413) is satified then 10
rows will be returned, for the second condition (orig_salary=1234 ) there
are 20 rows will be returned.
The order of display should be

The first 10 rows then
next 20 rows.
Thanks & Regards,
Ram

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message A. Kretschmer 2010-01-25 10:13:27 Re: Sql result b where condition
Previous Message Reid Thompson 2010-01-23 06:32:11 Re: Fragmentation/Vacuum, Analyze, Re-Index