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

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

  •  
  •   KagamineLenKai2 · 2016-08-19 09:49:40 +08:00 · 1893 次点击
    这是一个创建于 2821 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我运行
    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  
       2016-08-19 09:59:53 +08:00
    大哥,你 join 完全不对啊
    jy01264313
        2
    jy01264313  
       2016-08-19 10:00:27 +08:00
    上面没写完, join table on
    KagamineLenKai2
        3
    KagamineLenKai2  
    OP
       2016-08-19 10:09:00 +08:00
    @jy01264313 啊谢谢,大概是智障了……
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1235 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 18:14 · PVG 02:14 · LAX 11:14 · JFK 14:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.