Re: row numbering

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: row numbering
Дата
Msg-id 200502281928.04467.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: row numbering  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Ответы Re: row numbering  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
Karsten Hilbert wrote:
> There are 5 vaccinations in a given vaccination schedule.
>
> Patient had 3 shots.
>
> I want the view to show me that shot 4 and 5 are missing
> without having to enter the cardinality of the vaccination in
> the original data.

That sounds like you are trying to abuse the data model, so I'm not
surprised that it isn't easily possible.  As the data stored in a table
is inherently unordered, you can't really talk about order unless you
impose it yourself by way of assigning ordinal numbers or some other
sort key to your rows.

Even if you could, say, assign a fixed order to tables or views or
actually had some kind of automatic row number available, that would
still make the semantics of your data dependent of the particularities
of the queries that you use to access it, which doesn't sound like a
good idea to me.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

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

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: row numbering
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: row numbering