MERGE INTO SEARCH_DATA SD USING (SELECT COUNT(DATA) AS C FROM SEARCH_DATA WHERE DATA = 'B') S ON (S.C > 0) WHEN MATCHED THEN UPDATE SET SD.CNT = SD.CNT + 1 WHEN NOT MATCHED THEN INSERT VALUES ('B', 1)
oracle MERGE
2011. 7. 14. 17:15
MERGE INTO SEARCH_DATA SD USING (SELECT COUNT(DATA) AS C FROM SEARCH_DATA WHERE DATA = 'B') S ON (S.C > 0) WHEN MATCHED THEN UPDATE SET SD.CNT = SD.CNT + 1 WHEN NOT MATCHED THEN INSERT VALUES ('B', 1)