<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Hi Daniel,<br><br>Well, it depends on your database structure. If you have one table for each month:<br><br>SELECT t1.id, t1.east, t1.north, t1.rain,t2.rain,t3.rain FROM table1 as t1, table2 as t2, table3 as t3 WHERE...<br><br>Jaime<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Mensaje original ----<br>De: Daniel Victoria &lt;daniel.victoria@gmail.com&gt;<br>Para: Jaime Carrera &lt;jaicarrerahdez@yahoo.com&gt;<br>CC: grass &lt;grassuser@grass.itc.it&gt;<br>Enviado: lunes, 26 de marzo, 2007 16:36:23<br>Asunto: Re: [GRASS-user] Learning to use vector layers<br><br><div>Yea, that could do it also, just have to figure out how to perform<br>different queries for each column so I'd have average
 January on&nbsp;&nbsp;col<br>1 and avg February on two and so on. Probably a bunch of table<br>updates?<br><br>Thanks<br>Daniel<br><br>On 3/26/07, Jaime Carrera &lt;jaicarrerahdez@yahoo.com&gt; wrote:<br>&gt; Hi Daniel,<br>&gt;<br>&gt; You could also generate a table like this:<br>&gt;<br>&gt; id|easting|northing|9001|9002|9003|...|9012|9101|...<br>&gt;<br>&gt; Then you have your data in one table which can be<br>&gt; linked to the vector file. Such a table can be<br>&gt; generated from other tables using SQL commands.<br>&gt;<br>&gt; HTH<br>&gt;<br>&gt; Jaime<br>&gt;<br>&gt;<br>&gt; --- Daniel Victoria &lt;daniel.victoria@gmail.com&gt;<br>&gt; escribió:<br>&gt;<br>&gt; &gt; Hi all,<br>&gt; &gt;<br>&gt; &gt; I have a vector problem and I think it might be a<br>&gt; &gt; job for vector layers.<br>&gt; &gt; I have a postgresql table with daily meteorological<br>&gt; &gt; station data (~10<br>&gt; &gt; years, 300 stations) and I'd like to get average<br>&gt; &gt; monthly
 precipitation<br>&gt; &gt; for each station.<br>&gt; &gt; That I can easily do with a SQL query, generating a<br>&gt; &gt; view and attaching<br>&gt; &gt; the view to a vector file where the CAT column is<br>&gt; &gt; the station number.<br>&gt; &gt; The problem is, I can only attach one SQL view at a<br>&gt; &gt; time since the<br>&gt; &gt; vector file has only one category (from what I read,<br>&gt; &gt; it's one category<br>&gt; &gt; per layer connection correct?)<br>&gt; &gt;<br>&gt; &gt; So, I though about some options:<br>&gt; &gt; 1) either generate 1 vector file for each month -<br>&gt; &gt; simple but then I<br>&gt; &gt; don't learn about layers<br>&gt; &gt; 2) keep changing the database connection for each<br>&gt; &gt; month - works but<br>&gt; &gt; seems kind of improvisation<br>&gt; &gt; 3) Use layers, one layer for each month. I'd have<br>&gt; &gt; the advantage of not<br>&gt; &gt; having categories for stations with no data for a<br>&gt; &gt; specific month
 for<br>&gt; &gt; example and also, I'd learn about layers<br>&gt; &gt;<br>&gt; &gt; So, the proper questions:<br>&gt; &gt; Does this sounds like a job for vector layers?<br>&gt; &gt; How do I add categories to a vector file but, the<br>&gt; &gt; categories should<br>&gt; &gt; come from a column in a SQL view? From what I read,<br>&gt; &gt; v.category can<br>&gt; &gt; only add sequential cats and I'd like the cats to be<br>&gt; &gt; the station<br>&gt; &gt; number.<br>&gt; &gt;<br>&gt; &gt; Cheers and sorry for the long email<br>&gt; &gt; Daniel<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; grassuser mailing list<br>&gt; &gt; grassuser@grass.itc.it<br>&gt; &gt; <a target="_blank" href="http://grass.itc.it/mailman/listinfo/grassuser">http://grass.itc.it/mailman/listinfo/grassuser</a><br>&gt; &gt;<br>&gt;<br>&gt;<br>&gt; __________________________________________________<br>&gt; Correo Yahoo!<br>&gt; Espacio para todos tus mensajes,
 antivirus y antispam ¡gratis!<br>&gt; Regístrate ya - <a target="_blank" href="http://correo.espanol.yahoo.com/">http://correo.espanol.yahoo.com/</a><br>&gt;<br></div></div><br></div></div><br>__________________________________________________<br>Correo Yahoo!<br>Espacio para todos tus mensajes, antivirus y antispam ¡gratis! <br>Regístrate ya - http://correo.espanol.yahoo.com/ </body></html>