如果我將NULL提供給MySQL的ASCII()函數,它會回傳什麼?

PHPz
發布: 2023-08-23 19:37:02
轉載
970 人瀏覽過

如果我將NULL提供給MySQL的ASCII()函數,它會回傳什麼?

在這種情況下,ASCII()函數的輸出取決於我們是否將NULL作為字串提供,還是只提供NULL。以下範例將示範區別−

mysql> SELECT ASCII(null);
+-------------+
| ASCII(null) |
+-------------+
| NULL        |
+-------------+
1 row in set (0.00 sec)

mysql> SELECT ASCII('null');
+---------------+
| ASCII('null') |
+---------------+
| 110           |
+---------------+
1 row in set (0.00 sec)

mysql> Select ASCII(NULL);
+-------------+
| ASCII(NULL) |
+-------------+
| NULL        |
+-------------+
1 row in set (0.00 sec)

mysql> Select ASCII('NULL');
+---------------+
| ASCII('NULL') |
+---------------+
| 78            |
+---------------+
1 row in set (0.00 sec)
登入後複製

As we can observe from the above result set that when we will provide NULL or null as a string, ASCII() function will return the number code of the first character i.e. number code of the first character i.e. number code of of N in case of 'NULL' and number code of n in case of 'null', otherwise when we provide simply NULL then it returns NULL as output.

以上是如果我將NULL提供給MySQL的ASCII()函數,它會回傳什麼?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

來源:tutorialspoint.com
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板