V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
nlimpid
V2EX  ›  MySQL

请求一条 SQL 语句

  •  
  •   nlimpid ·
    nlimpid · 2018-10-31 16:23:46 +08:00 · 2196 次点击
    这是一个创建于 1975 天前的主题,其中的信息可能已经有所发展或是发生改变。

    dump 表,包含四个字段 id, name, phone, status

    INSERT INTO dump(id, name, phone, status)
    SELECT 1, "test", "111", 2
    FROM dump where not exists (select * from dump where name = "test" and status = 2)limit 1
    

    请问上面这个语句正确么?如果正确,是如何执行的。

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1405 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:29 · PVG 01:29 · LAX 10:29 · JFK 13:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.