Re: [SQL] Select subset of rows

2000-08-27 Thread Stephan Szabo
On Sun, 27 Aug 2000, John McKown wrote: > On Sun, 27 Aug 2000, Stephan Szabo wrote: > > > > > 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

Re: [SQL] Select subset of rows

2000-08-27 Thread John McKown
On Sun, 27 Aug 2000, Stephan Szabo wrote: > > 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 w

Re: [SQL] Select subset of rows

2000-08-27 Thread Stephan Szabo
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. Well, that depe

Re: [SQL] Select subset of rows

2000-08-27 Thread Stephan Szabo
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 where saltemp.salary=em

[SQL] Select subset of rows

2000-08-27 Thread Paulo Roberto Siqueira
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