时间:2021-07-01 10:21:17 帮助过:11人阅读
(2)MySQL(使用系统临时表DUAL)
INSERT INTO `test_tab`(`name`,`age`,`addresss`) SELECT ‘aa‘,2,‘bb‘ FROM DUAL WHERE NOT EXISTS(SELECT 1 FROM `test_tab` Where name == ‘aa‘)
(3)SQLServer
IF NOT EXISTS (SELECT id FROM books WHERE id = 1) INSERT INTO books (name) SELECT ‘Songxingzhu‘
Postgresql中无则插入的使用方法INSERT INTO WHERE NOT EXISTS
标签:last 方案 div lse mys end select address book