我有两个整形变量x,y,我想在SQL语句中 运用  字段F1 加x,F2减去y  请问该怎么写  谢谢  

解决方案 »

  1.   

    Declare @x int Declare @y int set @x = 1;set @y = 2select f1 + @x,f2 - @y from tableName要求字段f1,f2必须是数字,或者是字符数字
      

  2.   

    update table set f1=(f1 + x),f2=(f2 - y);
    x,y要代为数字
      

  3.   

    select (us_id+2)us_id,(us_cp_id-3)us_cp_id from sys_users where us_id=197
      

  4.   

    我是想把  获取了两个文本框中text1和text2的数字,然后用数据库中的字段,F1加text1中的数和F2减去text2中的数 
    然后用update语句   更新F1和F2进数据库该怎么写啊   在JSP页面中