English
 电子信箱
 加入收藏

  威盾防火墙 >> 新闻中心 >> 威盾新闻 >> SQL中if语句的用法示例

 

SQL中if语句的用法示例

威盾防火墙 2015-02-10

 

SQL中if语句是最常见也是最常用的SQL语句之一,下面就将为您举例说明SQL中if语句的用法,希望对您学习SQL中if语句的使用能够有些许帮助。

  1. _sql = " if not exists (select * from ProDesignSheet5 where Sheet5ID = '" + this.Sheet5id + "') "  
  2.               + " insert into ProDesignSheet5 values('" + this.Sheet5id  
  3.               + "','" + this.Consplacepbfee.ToString()  
  4.               + "','" + this.Searchtestfee.ToString()  
  5.               + "','" + this.Ccdesignfee.ToString()  
  6.               + "','" + this.Propreparefee.ToString()  
  7.               + "','" + this.Elecfee.ToString()  
  8.               + "','" + this.Workerdqfee.ToString()  
  9.               + "','" + this.Cjzpgdqfee.ToString()  
  10.               + "','" + this.Dxsgjxdqfee.ToString()  
  11.               + "','" + this.Debzglfee.ToString()  
  12.               + "','" + this.Jsqtzdkrate.ToString()  
  13.               + "','" + this.Gczljdfee.ToString()  
  14.               + "','" + this.Yuntufee.ToString()  
  15.               + "','" + this.Jfgzjgzfee.ToString()  
  16.               + "','" + this.Wsdyrfee.ToString()  
  17.               + "','" + this.Whclfee.ToString()  
  18.               + "','" + this.Bgyffee.ToString()  
  19.               + "','" + this.Yytfee.ToString()  
  20.               + "','" + this.Hlhtfee.ToString()  
  21.               + "','" + this.Jfxtfee.ToString()  
  22.               + "','" + this.Ybgjfee.ToString()  
  23.               + "','" + this.Gxzfzfee.ToString()  
  24.               + "','" + this.Lyglfee.ToString()  
  25.               + "','" + this.Jfzjfee.ToString()  
  26.               + "','" + this.Gdzjfee.ToString()  
  27.               + "','" + this.Gdlxlzjfee.ToString()  
  28.               + "','" + this.Workteamfee.ToString()  
  29.               + "','" + this.Condeptfee.ToString()  
  30.               + "','" + this.Tower.ToString()  
  31.               + "','" + this.Servicefee.ToString()  
  32.               + "','" + this.Checkfee.ToString()  
  33.               + "','" + this.Other.ToString()  
  34.               + "','" + this.ItemNum.ToString()  
  35.               + "','" + this.ItemName.ToString()  
  36.               + "','" + this.PassId.ToString()  
  37.               + "')"  
  38.               + " else update ProDesignSheet5 set Consplacepbfee='" + this.Consplacepbfee.ToString()  
  39.               + "',Searchtestfee='" + this.Searchtestfee.ToString()  
  40.               + "',Ccdesignfee='" + this.Ccdesignfee.ToString()  
  41.               + "',Propreparefee='" + this.Propreparefee.ToString()  
  42.               + "',Elecfee='" + this.Elecfee.ToString()  
  43.               + "',Workerdqfee='" + this.Workerdqfee.ToString()  
  44.               + "',Cjzpgdqfee='" + this.Cjzpgdqfee.ToString()  
  45.               + "',Dxsgjxdqfee='" + this.Dxsgjxdqfee.ToString()  
  46.               + "',Debzglfee='" + this.Debzglfee.ToString()  
  47.               + "',Jsqtzdkrate='" + this.Jsqtzdkrate.ToString()  
  48.               + "',Gczljdfee='" + this.Gczljdfee.ToString()  
  49.               + "',Yuntufee='" + this.Yuntufee.ToString()  
  50.               + "',Jfgzjgzfee='" + this.Jfgzjgzfee.ToString()  
  51.               + "',Wsdyrfee='" + this.Wsdyrfee.ToString()  
  52.               + "',Whclfee='" + this.Whclfee.ToString()  
  53.               + "',Bgyffee='" + this.Bgyffee.ToString()  
  54.               + "',Yytfee='" + this.Yytfee.ToString()  
  55.               + "',Hlhtfee='" + this.Hlhtfee.ToString()  
  56.               + "',Jfxtfee='" + this.Jfxtfee.ToString()  
  57.               + "',Ybgjfee='" + this.Ybgjfee.ToString()  
  58.               + "',Gxzfzfee='" + this.Gxzfzfee.ToString()  
  59.               + "',Lyglfee='" + this.Lyglfee.ToString()  
  60.               + "',Jfzjfee='" + this.Jfzjfee.ToString()  
  61.               + "',Gdzjfee='" + this.Gdzjfee.ToString()  
  62.               + "',Gdlxlzjfee='" + this.Gdlxlzjfee.ToString()  
  63.               + "',Workteamfee='" + this.Workteamfee.ToString()  
  64.               + "',Condeptfee='" + this.Condeptfee.ToString()  
  65.               + "',Tower='" + this.Tower.ToString()  
  66.               + "',Servicefee='" + this.Servicefee.ToString()  
  67.               + "',Checkfee='" + this.Checkfee.ToString()  
  68.               + "',Other='" + this.Other.ToString()  
  69.               //+ "',ItemNum='" + this.ItemNum.ToString()  
  70.               //+ "',ItemName='" + this.ItemName.ToString()  
  71.               //+ "',PassId='" + this.PassId.ToString()  
  72.               + "' where Sheet5id ='" + this.Sheet5id + "'"; 

相关内容: 最新内容:
教您如何进行SQL跨表更新[2015-02-10]
逐条更新数据的SQL语句写法[2015-02-10]
SQL条件语句实例[2015-02-10]
黑客入侵ASP+Access或ASP+MSSQL网站的手法[2015-02-10]
专家指出:SQL注入除攻击数据库外 威胁操作系统安全[2015-02-09]
SQL注入攻击成为新威胁将挑战操作系统安全[2015-02-09]
教您如何进行SQL跨表更新[2015-02-10]
逐条更新数据的SQL语句写法[2015-02-10]
SQL条件语句实例[2015-02-10]
解析专攻Mac的木马 图解[2015-02-10]
浅谈如何将网页防篡改[2015-02-10]
黑客大会揭开美国双重标准的面纱[2015-02-10]