• Mysql错误信息汇总


    目录:

    1. Every derived table must have its own alias

    内容:

    1. Every derived table must have its own alias

    SELECT app, s, 
    (
        SELECT COUNT(1) FROM sessions AS b WHERE s >= starttime AND s < endtime
    ) AS COUNT
    FROM (
        SELECT DISTINCT app, starttime AS s FROM sessions
    ) AS b

    注意红色加粗代码“AS b”,每个派生出来的表都必须有一个自己的别名,加个别名就可以了。

    2. 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

    报这个错因为创建存储过程的时候少了红框的内容:

    3.  No database selected

    错误代码: 1046
    No database selected

    此错原因是没有选择数据库

    4. Not unique table/alias: 'dept_manager'

    # 错误SQL
    SELECT * FROM dept_manager, dept_manager;
    # 正确SQL
    SELECT * FROM dept_manager AS a, dept_manager AS b;

    表dept_manager与自己级联时,要指定别名,不然会报此错误。

  • 相关阅读:
    web中间件常见漏洞
    心脏滴血与利用
    mimikatz提取windows密码
    Linux文本编辑器
    Linux打包(归档 )压缩命令
    linux文件和目录命令
    SSL原理
    windows server 2008 安装步骤
    渗透测试术语
    centos 7 修改yum配置
  • 原文地址:https://www.cnblogs.com/frank-quan/p/5799925.html
Copyright © 2020-2023  润新知