日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql输入select now()_mysql 中select now(); 是怎么执行的?没有指定FROM tablename?

發(fā)布時間:2025/4/16 数据库 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql输入select now()_mysql 中select now(); 是怎么执行的?没有指定FROM tablename? 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

mysql中 使用指令select now();就會獲取當(dāng)前時間日期。為什么沒有from table,這種指令也能執(zhí)行?

不指定表的時候,應(yīng)該如何理解select呢?

回復(fù)內(nèi)容:

mysql中 使用指令select now();就會獲取當(dāng)前時間日期。為什么沒有from table,這種指令也能執(zhí)行?

不指定表的時候,應(yīng)該如何理解select呢?

參考文檔

now()是mysql內(nèi)置函數(shù),返回當(dāng)前時間,而select可以不從表中獲取數(shù)據(jù)。即使使用select now() from table,這個table也會被忽略,因為now()用不上

SELECT can also be used to retrieve rows computed without reference to any table.

For example:

mysql> SELECT 1 + 1;

-> 2

You are permitted to specify DUAL as a dummy table name in situations where

no tables are referenced:

mysql> SELECT 1 + 1 FROM DUAL;

-> 2

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.

本文原創(chuàng)發(fā)布php中文網(wǎng),轉(zhuǎn)載請注明出處,感謝您的尊重!

總結(jié)

以上是生活随笔為你收集整理的mysql输入select now()_mysql 中select now(); 是怎么执行的?没有指定FROM tablename?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。