Subject | Re: [ib-support] Re: Update using two tables |
---|---|
Author | Lev Assinovsky |
Post date | 2002-02-13T13:00:30Z |
lester@... wrote:
I assume that SELECT tableB.datefield FROM tableB
where tableA.number = tableB.number)
produces just single value and we need MAX as a pseudo function
to let IB now that we produce a single value.
Lev Assinovsky Peterlink Web
Programmer St. Petersburg, Russia
Tel/Fax: +7 812 3275343 197022 ul.Chapigina 7а
E-mail: lev@...
> > This gives me the error 'Single row subquery produced more that oneIt depends on your condition tableA.number = tableB.number.
> > row' - which makes sense.
> >
> > Any other ideas ?
>
> If it gives multiple tableB.datefield entries which do you
> want?
>
I assume that SELECT tableB.datefield FROM tableB
where tableA.number = tableB.number)
produces just single value and we need MAX as a pseudo function
to let IB now that we produce a single value.
>--
> MAX(tableB.datefield) for the last date?
>
> > > update tableA
> > > set tableA.datefield = (SELECT tableB.datefield FROM tableB
> > > where tableA.number = tableB.number)
>
> update tableA
> set tableA.datefield = (SELECT MAX(tableB.datefield) FROM
> tableB
> where tableA.number = tableB.number)
>
> --
> Lester Caine
> -----------------------------
> L.S.Caine Electronic Services
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Lev Assinovsky Peterlink Web
Programmer St. Petersburg, Russia
Tel/Fax: +7 812 3275343 197022 ul.Chapigina 7а
E-mail: lev@...