Wednesday, 15 October 2014

MYSQL Update From within the same table using some condition

In Some cases, we need to update the table of one row with the values of the other row on the same table. Here is the query to do the same.
UPDATE patientinsurance dest
JOIN ( SELECT
patientCode,
policyNo
FROM
patientinsurance
WHERE
ID = 121590
) AS source

ON dest.patientCode = source.patientCode

SET dest.policyNo = source.policyNo
WHERE dest.id IN (121911)

2 comments:

Passing Parameter between two files using MVVM

This examples shows how to pass parameter between two zul screens. In this example, we are passing some parameters from the parent vm to...