这种 sql,怎么用 sqlalchemy 写?
INSERT INTO table_listnames (name, address, tele)
SELECT * FROM (SELECT 'Rupert', 'Somewhere', '022') AS tmp
WHERE NOT EXISTS (
SELECT name FROM table_listnames WHERE name = 'Rupert'
) LIMIT 1;
1
RockShake 2021-09-13 16:44:14 +08:00
|
2
knightdf 2021-09-14 10:39:59 +08:00
.prefix_with('IGNORE')应该也可以解决
|
3
wuwukai007 OP |