I want to update new column in a table with data from other tables.
The following query give me the data:

select t.id,min(r.starttime)
  from teams as t
    inner join rider_team as rt on (rt.team_id=t.id)
    inner join participants as p on (p.rider_id=rt.rider_id)
    inner join races as r on (r.id=p.race_id)
group by t.id;

Is it possible to write a query that do a:

update teams set created=min(r.starttime) ...

which updates all records in the teams table based on first query?

Thanks

BTW:
mysql> select version();
+----------------+
| version()      |
+----------------+
| 4.1.8-standard |
+----------------+


-- 
Jørn Dahl-Stamnes
homepage: http://www.dahl-stamnes.net/dahls/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to