You are permitted to specify DUAL as a dummy table name in situations where no tables are referenced:
DUAL is purely for the convenience of people who require that all SELECT statements should have FROM and possibly other clauses. MySQL may ignore the clauses. MySQL does not require FROM DUAL if no tables are referenced.
在不引用表的情况下,允许指定DUAL作为虚拟表名:
DUAL纯粹是为了方便那些要求所有select语句都应该有from和其他可能的子句的人。Mysql可能会忽略这些子句。如果没有表被引用,mysql不需要 from dual
SELECT 1 + 1;
SELECT 1 + 1 FROM DUAL;
参考:
https://www.cnblogs.com/sheseido/p/13862317.html
备注:
oracle中的DUAL, 用途类似,基本上就是为了符合语法结构。但是是一个实际存在的虚拟表,单行单列, 列Dummy,类型verchar2(1),oracle内部逻辑保证其有且只有一条数据,相比而言,mysql中的dual更虚,连个数据字典都没有。