[GRASSLIST:1002] Re: Populating fields of one table based on SQL query from another ta ble

David Finlayson david.p.finlayson at gmail.com
Thu May 4 12:07:30 EDT 2006


Yes that is possible. The trick is making sure the two time stamps are
EXACTLY the same. In mysql it would look like this (I think):

SELECT table1.sampleid, table1.easting, table1.northing, table2.timestamp
FROM table1, table2
WHERE table1.timestamp == table2.timestamp
ORDER BY table2.timestamp ASC;



On 5/4/06, Patton, Eric <epatton at nrcan.gc.ca> wrote:
> I'm trying to build an SQL query where the DGPS northings and eastings from
> a table of ship navigation gets written to a second table of sample
> locations only where the two tables have matching timestamps. So I basically
> have timestamps for my samples, but no positions. I'm unsure of the correct
> sql syntax (using Sqlite):
>
> Here's what the query should do:
>
> "select * from Easting and Northing in Ship_Navigation WHERE Timestamp ==
> Timestamp in Station_Samples." | db.execute
>
> Is this type of query possible?
>
> ~ Eric.
>
>


--
David Finlayson




More information about the grass-user mailing list