Search Postgresql Archives

Re: UPDATE .. JOIN?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replace the tables on this query with your joined tables 

Update service_reminderschedule srs	
set reminder_sent = false 
from ( 
        select ss.fk_man_service_id, ss.serviceschedule_id, v.vehicle_id 
                from serviceschedule ss 
                inner join manufactureservices ms 
                on ms.man_service_id = ss.fk_man_service_id 
                inner join vehicle_model vm 
                on vm.model_id = ms.fk_vehicle_model_id 
                inner join vehicle_info v 
                on v.fk_vehicle_model_id = vm.model_id 
                where ms.fk_vehicle_model_id = 1) ss 
where ss.vehicle_id = srs.fk_vehicle_id 
and srs.fk_serviceschedule_id = ss.serviceschedule_id and srs.date_sent is
null;



--
View this message in context: http://postgresql.1045698.n5.nabble.com/UPDATE-JOIN-tp1895125p5751790.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux