如何在单个SQL查询中更新和插入数据。
问题描述:
可能重复:
Oracle: how to UPSERT (update or insert into a table?)
How to Perform an UPSERT so that I can use both new and old values in update part如何在单个SQL查询中更新和插入数据。
我想知道如何单查询可以更新,并从数据库中删除数据。
请帮我这个:)
答
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...); DELETE FROM table_name
WHERE some_column=some_value
我觉得
+0
这些是2条询问 – 2012-04-23 18:55:44
+0
哦,我刚刚误解了 – Qzen 2012-04-23 18:57:40
答
delete from table where id = 1
update table set name = 'john' where id = 1
您是否有特定的示例要处理? – simchona 2012-04-23 18:51:34
更新并插入,或更新和删除?你的头衔和问题说两件不同的事情。 – mellamokb 2012-04-23 18:53:01