Query help, please

Поиск
Список
Период
Сортировка
От Rob Richardson
Тема Query help, please
Дата
Msg-id 04A6DB42D2BA534FAC77B90562A6A03D015545DA@server.rad-con.local
обсуждение исходный текст
Ответы Re: Query help, please  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
Список pgsql-novice
Greetings!

A charge consists of a set of coils arranged in one or more stacks.  It
is possible for a stack to be empty.  I need a query that lists all
possible stacks, along with the coils that are in each stack (if any).

Charge 1 can have 4 stacks.  Only stacks 2 and 3 are in use.  A plain
ordinary query can get me:

Stack    Coil    Position
2    A    1
2    B    2
3    C    1
3    D    2

I need:
Stack Coil    Position
1
2    A    1
2    B    2
3    C    1
3    D    2
4

The query is allowed to include the maximum possible number of stacks,
which is 8.

How can I get a result like this?

Thanks very much!

RobR

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

Предыдущее
От: Matthias Leopold
Дата:
Сообщение: logging table changes
Следующее
От: "Rob Richardson"
Дата:
Сообщение: Re: Query help, please