Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can one via sql update one or a group of records in one table from another?

Currently I am using a split-database. When I was using an embedding database such queries at the following worked for me.

UPDATE "addresses" SET "AREACODE" = (SELECT "AREACODE" FROM "tnumbers" WHERE "addresses"."ID" = "tnumbers"."ID" AND "tnumbers"."city" = 'OMAHA' )

Now when I run this effect all of the records with the city of OMAHA are in fact updated in the "AREACODE" field, but in all other records the existing "AREACODE" data is completely deleted. I have tried several other ways of getting around this bu seem to always come up with the same result.

Can one via sql update one or a group of records in one table from another?

Currently I am using a split-database. When I was using an embedding embedded database such queries at sql commands as the following worked for me.me:

UPDATE "addresses" SET "AREACODE" = (SELECT "AREACODE" FROM "tnumbers" WHERE "addresses"."ID" = "tnumbers"."ID" AND "tnumbers"."city" = 'OMAHA' )

Now when I run this effect this, in effect, all of the records with the city of OMAHA are in fact updated in the "AREACODE" field, but in all other records the existing "AREACODE" data is completely deleted. I have tried several other ways of getting around this bu seem to always come up with the same result.