Computer >> Computer tutorials >  >> Programming >> MySQL

What would be the result on concatenating server_id and UUID in MySQL?


Yes, you can easily concat the server_id and UUID.The syntax is as follows

SELECT CONCAT(@@ server_id,UUID())

Above, we have used @@server_id to get the value of the server_id. The @@server_id is the system defined variable. Let us no see the query

mysql> SELECT CONCAT(@@server_id, UUID()) AS ServerUUIDDemo;

The following is the output displaying the concatenated result of server_id and UUID

+---------------------------------------+
| ServerUUIDDemo                        |
+---------------------------------------+
| 14d16521c-3161-11e9-9ed7-78843ce8de7e |
+---------------------------------------+
1 row in set (0.00 sec)