# UPDATE statement with two tables

**URL:** <https://community.cdata.com/t/update-statement-with-two-tables/773>\
**Category:** CData Virtuality \[Archived\]\
**Tags:** article, cdata-virtuality\
**Created:** [June 10, 2024, 4:39pm UTC](https://community.cdata.com/t/update-statement-with-two-tables/773 "2024-06-10T16:39:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@anonymous](https://community.cdata.com/u/anonymous)\
**Post date:** [June 10, 2024, 4:39pm UTC](https://community.cdata.com/t/update-statement-with-two-tables/773/1 "2024-06-10T16:39:01Z")

</div>

Data Virtuality doesn’t support referencing a second table in a JOIN clause, such as:

```auto
UPDATE "dwh.adventureworks_salesorderheader" s SET status = i.status FROM PostgreSQL.salesorderheader h WHERE h.salesorderid = s.salesorderid

```

To run these kinds of queries, there are two possible workarounds:

1. Copy both tables to the same data source and use a native call:

2. Iterate over each row.

The first option is usually prefered due to much better runtime, as iterating over each row, as shown in the second option, is a very time-consuming method.
