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

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group