Subject | Re: Update using two tables |
---|---|
Author | ibfa2000 |
Post date | 2002-02-13T12:52:24Z |
> This gives me the error 'Single row subquery produced more that oneYour sub-query:
> row' - which makes sense.
>
> Any other ideas ?
>
SELECT tableB.datefield FROM tableB
where tableA.number = tableB.number
must not return more than 1 row. So you can:
- Modify the WHERE clause to be more restrictive
- or select only the first row: SELECT MIN(TableB.datefield) FROM ...
The other idea is to write a stored procedure.
Fabrice
>
> --- In ib-support@y..., Svein Erling Tysvær
> <svein.erling.tysvaer@k...> wrote:
> > Of the top of my head:
> >
> > update tableA
> > set tableA.datefield = (SELECT tableB.datefield FROM tableB
> > where tableA.number = tableB.number)
> >
> > I could be wrong,
> > Set