V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
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 · Oct 31, 2018 · 2631 views
    This topic created in 2740 days ago, the information mentioned may be changed or developed.

    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
    

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

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   865 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 470ms · UTC 23:02 · PVG 07:02 · LAX 16:02 · JFK 19:02
    ♥ Do have faith in what you're doing.