在SQL Server数据库中可以用语法execute('select 5*7')得到结果35,在mysql如何运行'select 5*7'字符串呢并得到35的结果集。

解决方案 »

  1.   

    execute 'select 5*7'
    or
    select 1*'5*7'
      

  2.   

    content='5*7';
     select content into gz;
      

  3.   

    语发不通,为什么SQL SERVER就那么方便呢
      

  4.   

    PREPARE stmt1 FROM 'SELECT 5*7';
    EXECUTE stmt1 
      

  5.   

    1、SQL SERVER是要MONEY的;
    2、你对MYSQL的语法还不是很熟悉。
      

  6.   

    Please try this way,you'll get what you expect.set @st = concat('select ',5*7);
    prepare s1 from @st;
    execute s1;
    drop prepare s1;