On Wed, 1 May 2002, Gary Stainburn wrote:
> Hi all, using the schema described below, I want to be able to update each
> arrival time from departure times and trip lengths.
>
> However the update fails because the subselect returns all three answers.
>
> How would I correct the update to make it work
>
> update trip set trip_arrive = (select t.trip_depart + r.route_time
> from route r, trip t where r.routeid = t.trip_route);
Do you really want to join with another "trip" in the subselect?
I think you probably want something like:
update trip set trip_arrive = (select trip.trip_depart + r.route_timefrom route r where r.routeid=trip.trip_route);