You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/05/07 07:29:53 UTC

[GitHub] [shardingsphere] kuangyoubo commented on issue #5452: MYSQL (no viable alternative at input)

kuangyoubo commented on issue #5452:
URL: https://github.com/apache/shardingsphere/issues/5452#issuecomment-625081522


   > CONVERT is not supported now.
   > You can use
   > 
   > ```
   > select cast(m as signed) as maxCustNo from (select substring(customer_code,3) as m from tb_sp_user_customer order by id desc limit 1) t;
   > ```
   > 
   > In my case:
   > 
   > ```
   > mysql-proxy> select cast(m as signed) as maxCustNo from (select substring(name, -1) as m from aa order by id desc limit 1) t;
   > +-----------+
   > | maxCustNo |
   > +-----------+
   > |         8 |
   > +-----------+
   > 1 row in set (0.02 sec)
   > ```
   
   select cast(m as signed) as maxUserCode from (select substring(user_code,3) as m from tb_sp_user order by id desc limit 1) t
   
   
   line 1:18 no viable alternative at input 'cast(massigned'
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org