I have a SQL query where I am trying to update a column in a table from data in another table. This works fine when I try to update all the records in the first table. UPDATE only rows which match another table in SQLI have a SQL query where I am trying to update a column in a table tbl. A from data in another table tbl. B. This. By submitting your personal information, you agree that Tech. Target and its partners may contact you regarding relevant content, products and special offers. You also agree that your personal information may be transferred and processed in the United States, and that you have read and agree to the Terms of Use and the Privacy Policy. I try to update all the records in tbl. A, however, in this case I only have missing data which I have identified and populated in tbl. B. When I try to update only the missing data the non matched data is also updated but to NULL. UPDATE tbl. A A. SET A. Fld. 1 SELECT B. Fld. 1. FROM tbl. B B. WHERE A. Fld. B. Fld. 2 Is it possible to update only the missing data
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2017
Categories |