I have two tables in a dataset. One of the tables has an empty column I'm trying to fill based on field matching in another table in the dataset. We're not yet able to use LINQ (Framework 2.0), but we are using a very good 3rd-party component called QueryADataset that enables standard SQL queries for in-memory datatables. I trust the component more than my rather rusty SQL skills.
I have the following query that gives the error: The column prefix 'Table1' does not match with a table name used in the query.'
UPDATE Table1
SET Field1 = (SELECT Field1 FROM Table2
WHERE
(Table1.Field2 = Table2.Field2
AND
Table1.Field3 = Table2.Field3))
Given that Table2.Field1 contains the value I need to store in Table1.Field1, and that I can find it by matching Fields 2 and 3, how should I rewrite this query to work correctly? I guess it should be some kind of join, but it's not coming to mind.
Thanks
Start Free Trial