SQL中if语句的用法示例

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中if语句的用法示例
URL网址:http://www.mswzjz.cn/qtweb/news49/537649.html

攀枝花网站建设、攀枝花网站运维推广公司-贝锐智能,是专注品牌与效果的网络营销公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 贝锐智能