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
KagamineLenKai2
V2EX  ›  MySQL

求教,这段 SQL 哪里错了……

  •  
  •   KagamineLenKai2 · Aug 19, 2016 · 2597 views
    This topic created in 3559 days ago, the information mentioned may be changed or developed.
    我运行
    SELECT * FROM company
    WHERE company.apply_id = 1

    SELECT * FROM apply
    WHERE apply.apply_id = 1
    都没有问题,但是为什么运行
    SELECT DISTINCT
    apply.client_name AS 客户姓名,
    apply.client_id AS 客户 ID,
    company.company_name AS 公司名称,
    company.company_province_name AS 公司省,
    company.company_city_name AS 公司市,
    company.company_county_name AS 公司县区,
    company.company_other AS 公司其他,
    company.department AS 部门,
    company.office_level_name AS 职位,
    company.salary AS 月薪,
    company.other_income AS 其他收入,
    company.industry_name AS 行业,
    company.nature AS 单位性质,
    company.company_size AS 公司规模
    FROM
    apply
    INNER JOIN company.apply_id = apply.apply_id
    的时候,就提示
    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.apply_id' at line 18

    求解 QAQ ,究竟是哪里错了?
    jy01264313
        1
    jy01264313  
       Aug 19, 2016
    大哥,你 join 完全不对啊
    jy01264313
        2
    jy01264313  
       Aug 19, 2016
    上面没写完, join table on
    KagamineLenKai2
        3
    KagamineLenKai2  
    OP
       Aug 19, 2016
    @jy01264313 啊谢谢,大概是智障了……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5856 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 07:32 · PVG 15:32 · LAX 00:32 · JFK 03:32
    ♥ Do have faith in what you're doing.