Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
UPDATE tblProductRecord
SET ProductName = (SELECT ProductName FROm tblProductRecord WHERE ProductUID = 1887 )
WHERE ProductUID = 1884
/* --data from both rows prior update
1 Chang 1 1 10 boxes x 20 bags 18.0000 39 0 10 0
3 Aniseed Syrup 1 2 12 - 550 ml bottles 10.0000 13 70 25 0
*/
--update statement
UPDATE b
SET ProductName = p.ProductName,
QuantityPerUnit = p.QuantityPerUnit
FROM Products b
INNER JOIN (select productid, productname, QuantityPerUnit from products where productid = 3) p ON p.productid = 3
WHERE b.productid = 1
/* -- data in both rows after update
1 Aniseed Syrup 1 1 12 - 550 ml bottles 18.0000 39 0 10 0
3 Aniseed Syrup 1 2 12 - 550 ml bottles 10.0000 13 70 25 0
*/
[code]
This effectively allows you to join to the row without an "actual join" occurring : note the ON clause doesnt reference the outer table. Be wary though this should only be used when updating a single row (as indicated by the WHERE clause) as it will cause multiple updates with same data
"I'm living so far beyond my income that we may almost be said to be living apart