nested sub-select ?

Поиск
Список
Период
Сортировка
От Chris Martin
Тема nested sub-select ?
Дата
Msg-id 20000605212923.90074.qmail@hotmail.com
обсуждение исходный текст
Список pgsql-sql
Hi,

Anyone know if Postgresql can replicate this Oracle nested sub-select query 
(it uses the Oracle CURSOR operator)

SELECT deptname,      CURSOR (SELECT Empname, Sal             FROM emp             WHERE emp.deptno=department.deptno)
ASEmployees
 
FROM department
Where deptno=x


I want to output a nested list like this (ie. rows from the aliased 
employees table within their respective department)

Deptname: Sales         Employees-row-no: 1         Empname: Smith         Sal: 2000
         Employees-row-no: 2         Empname: Jones         Sal: 1000           ....


It would be very useful to have the ability to nest multiple CURSOR 
statements (or equivalent) within the SELECT clause.

Any help appreciated.

TIA

Chris Martin



________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com



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

Предыдущее
От: Aaron Sethman
Дата:
Сообщение: Finding number of updated rows in pl/pgsql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Vacuum problem in my system ?