±¾À´ÒªÐ´¸öupdateÓï¾ä update table_a A set A.flag=1 where A.id in (select B.id from table_b B) ½á¹ûÎóд³É update table_a A set A.flag=1 where A.id in (select A.id from table_b B)
Ϊɶ´íÎóµÄд·¨£¬oralce±àÒë²»±¨´íÄØ£¿ ¶øÇÒ Ö»ÒªB±íÖÐÓÐÊý¾Ý£¬A¾ÍÈ«±í¸üÐÂÁË B±íûÊý¾Ý£¬A±í¾ÍupdateÁË0Ìõ¼Ç¼£¬ ËÄܽâÊÍÏ£¿ÊÇoracleµÄbugô£¿ (select A.id from table_b B)Õâ¾äÊÇ¿ÉÒÔÖ´ÐÐµÄ Äã˵µÄ´íÎóµÄд·¨Ö»ÊǺÍÄãµÄ±¾Òâ²»Ò»Ö£¬Óï·¨ÉÏû´í UP~ select A.id from table_b B
µ¥¶ÀµÄÓï¾äÔËÐÐ: Ìáʾ:ora-00904µÄ´íÎó!
select * from test a where name in( select a.name from test b)