Search Postgresql Archives

Re: row numbering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux