Subject Re: Update using two tables
Author ibfa2000
> This gives me the error 'Single row subquery produced more that one
> row' - which makes sense.
>
> Any other ideas ?
>

Your sub-query:

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