我需要更新我的數據庫表中的值。以下是我爲同樣的問題所寫的問題。如何執行批量更新查詢
update product set product_name='AAAA' where product_id='1'
update product set product_name='BBB' where product_id='2'
update product set product_name='CCC' where product_id='3'
update product set product_name='DDDD' where product_id='4'
當我更新這些上述語句時,只有我的第4行得到更新。 我在批量搜索執行UPDATE命令,但沒有找到任何幫助。
請讓我知道如何確保上面的所有命令都不會被上一條語句覆蓋而被執行。
我正在使用Sqlite,而不是mySql。
請出示你在哪裏試圖執行這些語句的代碼。 –