Mengembalikan nilai yang diberikan. Ketika digunakan untuk menghasilkan kolom kumpulan hasil, NAME_CONST() menyebabkan kolom tersebut memiliki nama tertentu. Argumennya harus konstan.
SELECT NAME_CONST('myname', 14);
+--------+
| myname |
+--------+
| 14 |
+--------+
This function is for internal use only. The server uses it when writing statements from stored programs that contain references to local program variables, as described in Section 27.7, “Stored Program Binary Logging”. You might see this function in the output from mysqlbinlog.
SELECT NAME_CONST('myname', 14);
+--------+
| myname |
+--------+
| 14 |
+--------+
For your applications, you can obtain exactly the same result as in the example just shown by using simple aliasing, like this:
SELECT 14 AS myname;
+--------+
| myname |
+--------+
| 14 |
+--------+
1 row in set (0.00 sec)