Mysql
 sql >> Datenbank >  >> RDS >> Mysql

MySQL fügt UUID in einer Tabelle Bindestriche hinzu

SET @x = '5967ca5e6162317eb4a825dcdcde0aea';

SELECT CONCAT_WS('-',MID(@x,1,8),MID(@x,9,4),MID(@x,13,4),MID(@x,17,4),MID(@x,21,1000))n;
+--------------------------------------+
| n                                    |
+--------------------------------------+
| 5967ca5e-6162-317e-b4a8-25dcdcde0aea |
+--------------------------------------+