Subject Re: Doing an UPDATE where the data source requires a join between two tables
Author mspencewasunavailable
--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@...> wrote:
>
> Hi Michael!
>
>
> This is simpler, but hopefully what you want to do:
>
> update SCHED S
> set "Last Performed" = (select max(A."Date")
> from artrans A
> where S."Acc ID" = A."Acc ID"
> and S."Serv ID" = A."Serv ID"
> and A."Code" in (0, 1, 2, 10))
> where S."Last Performed" <> (select max(A2."Date")
> from artrans A2
> where S."Acc ID" = A2."Acc ID"
> and S."Serv ID" = A2."Serv ID"
> and A2."Code" in (0, 1, 2, 10))
>

Yes, thank you very much. Exactly what I was looking for. For some
reason, updates always confuse me.


Michael D. Spence
Mockingbird Data Systems, Inc.