码迷,mamicode.com
首页 > 数据库 > 详细

sql查询,更新,删除,操作。

时间:2017-04-07 20:42:56      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:set   sel   order   inf   rom   person   team   time   sql查询   

UPDATE ht_plan_triptime ppt
SET ppt.lock_status = ‘1‘
WHERE ppt.lock_status <> ‘1‘
    AND ppt.plan_id = ?
    AND ppt.allowed_person > 0
    AND ppt.allowed_person <= (SELECT
                                 COUNT(*)
                               FROM ht_tourist_team_info ti
                                 INNER JOIN ht_order_info oi ON oi.order_id = ti.order_id
                                 INNER JOIN ht_order_team_relation otr ON otr.order_id = oi.order_id AND otr.del_flag = ‘1‘
                               WHERE otr.trip_id = ‘2f2a83c4fa1749c0ac4ed00626eef91d‘
                                   AND ti.del_flag = ‘1‘
                                   AND oi.del_flag = ‘1‘
                                   AND oi.apply_status = ‘1‘
                              )
                             

sql查询,更新,删除,操作。

标签:set   sel   order   inf   rom   person   team   time   sql查询   

原文地址:http://www.cnblogs.com/xing-cctv/p/6679404.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!