Re: Select subset of rows

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Select subset of rows
Дата
Msg-id Pine.BSF.4.10.10008271404001.47801-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Select subset of rows  ("Paulo Roberto Siqueira" <paulo.siqueira@usa.net>)
Ответы Re: Select subset of rows
Список pgsql-sql
Of course immediately after sending the last message and logging off my
ISP I figured out the simpler way for the third one:

begin;
select salary into temp saltemp from employee order by salary desc limit 5;
select name from employee where exists (select * from saltemp wheresaltemp.salary=employee.salary);
end;

Stephan Szabo
sszabo@bigpanda.com

On Sun, 27 Aug 2000, Paulo Roberto Siqueira wrote:

>     Hi folks,
> 
>     I have this table
> 
> CREATE TABLE EMPLOYEE (ID_EMP INT4 PRIMARY KEY, NAME VARCHAR(35), SALARY
> NUMERIC(5,2));
> 
>     I want to select only the employees' names who have the 5 highest salaries.
> 
> 
> 
> 
> Paulo Siqueira
> 



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Paulo Roberto Siqueira"
Дата:
Сообщение: Select subset of rows
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Select subset of rows