<br><br><div><span class="gmail_quote">On 5/10/07, <b class="gmail_sendername"><a href="mailto:postgis-users-request@postgis.refractions.net">postgis-users-request@postgis.refractions.net</a></b> <<a href="mailto:postgis-users-request@postgis.refractions.net">
postgis-users-request@postgis.refractions.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Message: 8<br>Date: Thu, 10 May 2007 11:54:59 +0200
<br>From: ValiSystem <<a href="mailto:vali.system@free.fr">vali.system@free.fr</a>><br>Subject: Re: [postgis-users] RE: [Geoserver-users] Time series in<br>        postGIS?<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@postgis.refractions.net">
postgis-users@postgis.refractions.net</a>><br>Message-ID: <<a href="mailto:37FC4F18-0DB6-4291-A26A-D10D3AD01789@free.fr">37FC4F18-0DB6-4291-A26A-D10D3AD01789@free.fr</a>><br>Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
<br><br><br>On 9 mai 07, at 15:06, Stephen Crawford wrote:<br><br>> Andrea,<br>><br>> Is there a good way to define the view so that the dates, which are<br>> rows in<br>> the normal table, become columns in the view, and also that the
<br>> view is<br>> always updated with the most recent date?<br><br>Stephen,<br><br>There is now way to do such a thing in a pure relational way (read<br>simple sql statements). You could imagine aggregate several rows on a
<br>result column, but you cannot  distribute row values of the same<br>columns into several result columns. (this would be a mix of grouping<br>but showing each row values of groups). The problem is that there is<br>now way to differentiate rows in SQL. You are manipulating data sets,
<br>not values.<br></blockquote></div><br>This is not completely accurate. <br><br>You can do what you want using Cross-Tabulations. Although I am not going to go into the details of these procedures (a simple Google search will lead you articles from people that are far better than me at articulating the step-by-step procedures), I can tell you that you can do crosstabs by cross-joins, by outer-joins, by Subqueries, by CASE expressions, etc - all standard SQL.
<br><br>Hope this helps,<br><br>Ragi Y. Burhum<br>