MySQL:
UPDATE ChgCfm t1
INNER JOIN tb_dz_file t2 ON t1.ID = t2.ID
SET t1.CfmStatus =0
WHERE t1.CmfFile ='001'
SQLserver:
UPDATE t1 SET t1.CfmStatus=0 FROM ChgCfmRcd t1
INNER JOIN tb_dz_file t2 on t1.RcdID=t2.DzID WHERE t1.CmfFile='001'
UPDATE t1 SET t1.CfmStatus=0 FROM ChgCfmRcd t1
WHERE EXISTS ( SELECT 1 FROM tb_dz_file t2 WHERE t1.RcdID=t2.DzID AND t1.CmfFile='001');
Oracle:
UPDATE ChgCfmRcd t1 SET t1.CfmStatus=0
WHERE EXISTS ( SELECT 1 FROM tb_dz_file t2 WHERE t1.RcdID=t2.DzID AND t1.CmfFile='001');
组合一个数:
SELECT CONCAT(SUBSTRING('0105',1,2),'01')