UPDATE [ ONLY ] table SET col = expression [, ...] [ FROM fromlist ] [ WHERE condition ]
UPDATE ¤Ï¡¢¾ò·ï¤òËþ¤¿¤¹Á´¤Æ¤Î¹Ô¤Î»ØÄꤵ¤ì¤¿Îó¤ÎÃͤòÊѹ¹¤·¤Þ¤¹¡£Êѹ¹¤µ¤ì¤ë¤Ù¤Îó¤Î¤ß¤¬Ê¸Æâ¤Îcolumns¥Ñ¥é¥á¡¼¥¿¤Ë¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
SELECT ¤ÈƱ¤¸¹½Ê¸¤ò»È¤Ã¤ÆÇÛÎó¤ò»²¾È¤·¤Þ¤¹¡£¤Ä¤Þ¤ê¡¢1¤Ä¤ÎÇÛÎóÍ×ÁǤ⡢¤¢¤ëÈϰϤˤ錄¤ëÇÛÎóÍ×ÁǤ⡢ÇÛÎóÁ´ÂΤâ1¤Ä¤ÎÌ䤤¹ç¤ï¤»¤Ç¹¹¿·¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë¤Ï½ñ¤¹þ¤ß¸¢¸Â¤¬É¬ÍפǤ¹¡£¤¢¤ï¤»¤Æ¡¢WHERE¾ò·ïÆâ¤Ç»ØÄꤷ¤¿Ãͤò»ý¤Ä¥Æ¡¼¥Ö¥ë¤Ø¤ÎÆɤ߹þ¤ß¸¢¸Â¤âɬÍפˤʤê¤Þ¤¹¡£
¥Ç¥Õ¥©¥ë¥È¤Ç¡¢UPDATE¤Ï»ØÄꤵ¤ì¤¿¥Æ¡¼¥Ö¥ë¤È¤½¤Î¥µ¥Ö¥Æ¡¼¥Ö¥ë¤Î¥¿¥×¥ë¤ò¹¹¿·¤·¤Þ¤¹¡£»ØÄꤵ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Î¤ß¤ò¹¹¿·¤·¤¿¤¤¾ì¹ç¤ÏONLY¶ç¤ò»ÈÍѤ·¤Æ²¼¤µ¤¤¡£
kind Îó¾å¤Î Drama ¤È¤¤¤¦Ã±¸ì¤ò Dramatic ¤ËÊѹ¹¤·¤Þ¤¹¡£
UPDATE films SET kind = 'Dramatic' WHERE kind = 'Drama'; SELECT * FROM films WHERE kind = 'Dramatic' OR kind = 'Drama'; code | title | did | date_prod | kind | len -------+---------------+-----+------------+----------+------- BL101 | The Third Man | 101 | 1949-12-23 | Dramatic | 01:44 P_302 | Becket | 103 | 1964-02-03 | Dramatic | 02:28 M_401 | War and Peace | 104 | 1967-02-12 | Dramatic | 05:57 T_601 | Yojimbo | 106 | 1961-06-16 | Dramatic | 01:50 DA101 | Das Boot | 110 | 1981-11-11 | Dramatic | 02:29