UPDATE test SET
content = REPLACE(content,'国家级',''),content = REPLACE(content,'世界级',''),content = REPLACE(content,'最高级','')
,content = REPLACE(content,'最佳',''),content = REPLACE(content,'首个',''),content = REPLACE(content,'首选','')
,content = REPLACE(content,'唯一',''),content = REPLACE(content,'世界级',''),content = REPLACE(content,'世界级','')
,content = REPLACE(content,'最好',''),content = REPLACE(content,'最大',''),content = REPLACE(content,'精确','')
,content = REPLACE(content,'顶级',''),content = REPLACE(content,'最高',''),content = REPLACE(content,'最低','')
,content = REPLACE(content,'最',''),content = REPLACE(content,'最具',''),content = REPLACE(content,'最便宜','')
,content = REPLACE(content,'最新',''),content = REPLACE(content,'最先进',''),content = REPLACE(content,'最大程度','')
,content = REPLACE(content,'最新技术',''),content = REPLACE(content,'最先进科学',''),content = REPLACE(content,'国家级产品','')
,content = REPLACE(content,'填补国内空白',''),content = REPLACE(content,'绝对',''),content = REPLACE(content,'独家','')
,content = REPLACE(content,'首家',''),content = REPLACE(content,'最先进',''),content = REPLACE(content,'万能','')
,content = REPLACE(content,'第一品牌',''),content = REPLACE(content,'金牌',''),content = REPLACE(content,'名牌','')
,content = REPLACE(content,'优秀',''),content = REPLACE(content,'最先',''),content = REPLACE(content,'顶级','')
,content = REPLACE(content,'独家',''),content = REPLACE(content,'全网销量第一',''),content = REPLACE(content,'全球首发','')
,content = REPLACE(content,'全国首家',''),content = REPLACE(content,'全网首发',''),content = REPLACE(content,'世界领先','')
,content = REPLACE(content,'顶级工艺',''),content = REPLACE(content,'最新科学',''),content = REPLACE(content,'最新技术','')
,content = REPLACE(content,'最先进加工工艺',''),content = REPLACE(content,'最时尚',''),content = REPLACE(content,'极品','')
,content = REPLACE(content,'顶级',''),content = REPLACE(content,'顶尖',''),content = REPLACE(content,'终极','')
,content = REPLACE(content,'王牌',''),content = REPLACE(content,'销量冠军',''),content = REPLACE(content,'最受欢迎','')
,content = REPLACE(content,'NO.1',''),content = REPLACE(content,'Top1',''),content = REPLACE(content,'极致','')
,content = REPLACE(content,'永久',''),content = REPLACE(content,'王牌',''),content = REPLACE(content,'掌门人','')
,content = REPLACE(content,'领袖品牌',''),content = REPLACE(content,'独一无二',''),content = REPLACE(content,'独家','')
,content = REPLACE(content,'绝无仅有',''),content = REPLACE(content,'前无古人',''),content = REPLACE(content,'史无前例','')
,content = REPLACE(content,'第一','')
WHERE id = 2;
UPDATE shopnc_goods_common SET goods_body = 

INSERT(goods_body, INSTR(goods_body,'<div class="p_titles_2">商品特色</div>'), INSTR(goods_body,'<div class="p_titles_2">商品参数</div>')- INSTR(goods_body,'<div class="p_titles_2">商品特色</div>'),'')

WHERE gc_id_2 in (294,284,289,261,216) and goods_body LIKE '%商品特色%'
SELECT shopnc_cps.order_sn as 订单号,shopnc_orders.buyer_name as 用户名,FROM_UNIXTIME(shopnc_orders.add_time,'%Y-%m-%d %H:%i:%S') as 下单时间,
shopnc_order_goods.goods_name as 商品名称,shopnc_orders.store_name as 店铺名,shopnc_orders.CustomerNo as 用户编号,
CASE
WHEN shopnc_orders.order_state = '0' THEN '以取消'
WHEN shopnc_orders.order_state = '10' THEN '未付款'
WHEN shopnc_orders.order_state = '20' THEN '以付款'
WHEN shopnc_orders.order_state = '30' THEN '以发货'
WHEN shopnc_orders.order_state = '40' THEN '以收货'
END AS 订单状态, CASE
WHEN shopnc_goods.gc_id_1 = '1' THEN '汽车精品'
WHEN shopnc_goods.gc_id_1 = '15' THEN '服装鞋帽'
WHEN shopnc_goods.gc_id_1 = '53' THEN '箱包配饰'
WHEN shopnc_goods.gc_id_1 = '77' THEN '数码家电'
WHEN shopnc_goods.gc_id_1 = '124' THEN '个护彩妆'
WHEN shopnc_goods.gc_id_1 = '159' THEN '家居日用'
WHEN shopnc_goods.gc_id_1 = '215' THEN '珠宝收藏'
WHEN shopnc_goods.gc_id_1 = '264' THEN '食品保健'
WHEN shopnc_goods.gc_id_1 = '302' THEN '旅游度假'
WHEN shopnc_goods.gc_id_1 = '313' THEN '母婴玩具'
WHEN shopnc_goods.gc_id_1 = '319' THEN '燕京八绝'
WHEN shopnc_goods.gc_id_1 = '354' THEN '手机充值'
WHEN shopnc_goods.gc_id_1 = '355' THEN '其他分类'
END as 商品分类, CASE
WHEN shopnc_orders.payment_code = 'offline' THEN '货到付款'
WHEN shopnc_orders.payment_code = 'online' THEN '在线支付'
WHEN shopnc_orders.payment_code = 'wxpay' THEN '微信支付'
WHEN shopnc_orders.payment_code = 'alipay' THEN '支付宝'
WHEN shopnc_orders.payment_code = 'unionpay' THEN '银联'
WHEN shopnc_orders.payment_code = 'pingan' THEN '平安银行'
ELSE '不知道什么支付方式'
END
as 支付方式,shopnc_order_goods.goods_id as 商品ID,shopnc_order_goods.goods_price as 商品价格,shopnc_order_goods.goods_pay_price as 订单支付价格,
shopnc_order_goods.goods_num as 商品数量,shopnc_order_goods.unit_code as 德珍商品编号,shopnc_order_goods.goods_usevipdiscount as 会员折扣,shopnc_order_goods.goods_usediscount as 代金券,
shopnc_order_goods.goods_useuserpoint as 使用购物金,shopnc_order_goods.goods_freight as 运费,shopnc_order_goods.living_goods_discount as 正在直播商品优惠,shopnc_order_goods.yihe_cuxiao as 移动端货到付款优惠,
shopnc_order_goods.gc_id as 商品分类 ,
CASE
WHEN shopnc_goods.gc_id_1 IN (15,53,124,159,264) AND shopnc_goods.goods_promotion_type =0 THEN '5%'
WHEN shopnc_goods.gc_id_1 IN (15,53,124,159,264) AND shopnc_goods.goods_promotion_type != 0 THEN '3%'
WHEN shopnc_goods.gc_id_1 IN (215,302) THEN '3%'
WHEN shopnc_goods.gc_id_1 = '77' AND shopnc_goods.gc_id_2 != '110' THEN '3%'
ELSE '0%'
END as 佣金比例 , (CASE
WHEN shopnc_goods.gc_id_1 IN (15,53,124,159,264) AND shopnc_goods.goods_promotion_type =0 THEN 0.05
WHEN shopnc_goods.gc_id_1 IN (15,53,124,159,264) AND shopnc_goods.goods_promotion_type != 0 THEN 0.03
WHEN shopnc_goods.gc_id_1 IN (215,302) THEN 0.03
WHEN shopnc_goods.gc_id_1 = '77' AND shopnc_goods.gc_id_2 != '110' THEN 0.03
ELSE 0
END)*(shopnc_order_goods.goods_pay_price - 21) AS 佣金金额,'16' AS 包装费 ,'5' AS 邮费 ,
shopnc_order_goods.rcb as 使用充值卡金额,shopnc_order_goods.pd as 使用预付款金额, CASE
WHEN shopnc_cps.c_id = '17574' THEN '汽车精品'
WHEN shopnc_cps.c_id = '18000' THEN '领克特'
WHEN shopnc_cps.c_id = '19000' THEN '唯一传媒'
END as cps来源, CASE
WHEN shopnc_orders.client = '1' THEN '网站'
WHEN shopnc_orders.client = '2' THEN 'wap'
WHEN shopnc_orders.client = '3' THEN '微信'
END as 订单来源 ,
shopnc_order_push.order_push_sn as 德珍订单号 FROM shopnc_cps LEFT JOIN shopnc_orders ON shopnc_cps.order_sn = shopnc_orders.order_sn LEFT JOIN shopnc_order_goods ON shopnc_orders.order_id = shopnc_order_goods.order_id LEFT JOIN
shopnc_goods ON shopnc_order_goods.goods_id =shopnc_goods.goods_id LEFT JOIN shopnc_order_push ON shopnc_orders.order_sn = shopnc_order_push.order_sn
WHERE shopnc_orders.add_time >= '1435680000' and shopnc_orders.add_time <= '1438358400'

最后一个有点复杂

一些稍微复杂点的sql语句的更多相关文章

  1. mybatis 中的稍微复杂些的sql语句

    mybatis 中的稍微复杂些的sql语句: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYP ...

  2. SQL语句到底是怎么执行的

    写在前面的话:有时不理解SQL语句各个部分执行顺序,导致理解上出现偏差,或者是书写SQL语句时随心所欲,所以有必要了解一下sql语句的执行顺序.可以有时间自己写一个简单的数据库,理解会更加深入.下面就 ...

  3. SQL语句中各个部分的执行顺序(转)

    原文链接:http://www.tuicool.com/articles/fERNv2 写在前面的话:有时不理解SQL语句各个部分执行顺序,导致理解上出现偏差,或者是书写SQL语句时随心所欲,所以有必 ...

  4. 使用with语句来写一个稍微复杂sql语句,附加和子查询的性能对比

    今天偶尔看到sql中也有with关键字,好歹也写了几年的sql语句,居然第一次接触,无知啊.看了一位博主的文章,自己添加了一些内容,做了简单的总结,这个语句还是第一次见到,学习了.我从简单到复杂地写, ...

  5. SQL点滴10—使用with语句来写一个稍微复杂sql语句,附加和子查询的性能对比

    原文:SQL点滴10-使用with语句来写一个稍微复杂sql语句,附加和子查询的性能对比 今天偶尔看到sql中也有with关键字,好歹也写了几年的sql语句,居然第一次接触,无知啊.看了一位博主的文章 ...

  6. [NHibernate]查看NHibernate生成的SQL语句

    最近接触到一个用Spring.Net结合NHIbernate的项目,第一次使用,有很多配置,数据操作一旦出问题,很难找到原因,那么如何查看NHibernate发送给数据库的SQL语句呢? 当然我们可以 ...

  7. SQL语句操作数据与一些函数使用的丰富数据库

    数据库有多重要,其实不用我说,但该怎么运用好数据库下SQL语句与其它的如“函数”等等,那就需要我们大家多多去练习并总结其中的窍门,或许你的总结没那么好,担只要你的练习足够多,就算那不是窍门,那也将是你 ...

  8. C#.NET 大型企业信息化系统集成快速开发平台 4.1 版本 - 面向数据库SQL语句的应用开发二

    很多传统企业.包括系统集成类的IT企业,若不是从事专业软件开发领域的,能做出一套适合本公司企业信息化的灵活的信息系统还是很有难度的,还有一些已经多年不写程序的资深开发人员,初学者,都难把一个整套系统实 ...

  9. 在Excel中使用SQL语句查询和筛选

    本文转自:http://blog.sina.com.cn/s/blog_5fc375650102e1g5.html 今天在微博上看到@数据分析精选 分享的一篇文章,是关于<在Excel中使用SQ ...

随机推荐

  1. hibernate中数据库方言

    在配置hibernate.cfg.xml时需指定使用数据库的方言: 例: <property name="dialect">org.hibernate.dialect. ...

  2. 在react native用到的javascript 的一些关键知识(整理中)

    发现了一个讲解javascript的好网站,分享一下,讲的非常棒! 注意,这些文章都可以选择中文进行阅读! 下面这个连接是关于prototype的: https://developer.mozilla ...

  3. Android 动态生成 EditTest

    这几天,开始一个项目,需要一个小效果,就是一个输入邮箱地址的EditTest 需要动态的添加.默认有两个,然后最多5个,手机的屏幕总是有限的 好的 ,这就上代码了 布局文件 <LinearLay ...

  4. javascript推荐书籍

    本文转载自http://www.cnblogs.com/zfc2201/archive/2012/07/22/2604236.html感谢作者 WEB前端研发工程师,在国内算是一个朝阳职业,这个领域没 ...

  5. [译]SQL Server分析服务的权限配置

    简介: 本文介绍如何配置SSAS数据库和cube相关维度的安全设置. 相对数据引擎来说,在Management Studio中配置分析服务的安全设置基本没什么区别.但是也会有一些限制,比如SSAS的权 ...

  6. 如何在 SSAS服务器之间做同步

    简介: 从SQL Server 2005开始,分析服务就支持了同步的功能.本文将介绍如何在SQL Server 2012下同步Adventureworks的分析服务数据库.通过同步的功能,我们就来可以 ...

  7. [MongoDB]MongoDB与JAVA结合使用CRUD

    汇总: 1. [MongoDB]安装MongoDB2. [MongoDB]Mongo基本使用:3. [MongoDB]MongoDB的优缺点及与关系型数据库的比较4. [MongoDB]MongoDB ...

  8. java基础(四)

    一.面向对象的三个基本特征: 1.封装,将对象的实现细节隐藏起来,并通过公共接口暴露相关功能: 2.继承,代码复用的表现,当子类继承父类后,子类作为一种特殊的父类,直接获得父类的属性和方法: 3.多态 ...

  9. Timer计时器

    private Timer timer; timer.schedule(new TimerTask() { @Override public void run() { if (isStopedReco ...

  10. 弹性布局flex-兼容问题

    这里弹性布局的用法就不说了 用过的都知道很方便 虽然现在弹性布局已经实现标准了 但是还是存在一些兼容问题 旧版本 (一些低版本的浏览器) display:-webkit-box; 新版本(目前的标准版 ...