mysql> select concat('uuid:',select replace(uuid(),'-',''));
报错如下
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select replace(uuid(),'-',''))' at line 1

解决方案 »

  1.   

     select concat('uuid:',replace(uuid(),'-',''));
    这样写  去掉中间那个select
      

  2.   

    mysql> select concat('uuid:',(select replace(uuid(),'-','')));
    +-------------------------------------------------+
    | concat('uuid:',(select replace(uuid(),'-',''))) |
    +-------------------------------------------------+
    | uuid:36185cf0add411e89d643464a9d3d8f5           |
    +-------------------------------------------------+
    1 row in set (0.00 sec)mysql> select concat('uuid:',replace(uuid(),'-',''));
    +----------------------------------------+
    | concat('uuid:',replace(uuid(),'-','')) |
    +----------------------------------------+
    | uuid:3fcd6a45add411e89d643464a9d3d8f5  |
    +----------------------------------------+
    1 row in set (0.00 sec)mysql>