码迷,mamicode.com
首页 > 其他好文 > 详细

这些~~~

时间:2015-09-27 20:12:24      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

SELECT * smokemommon WHERE yanming=‘长城(盛世5号)‘ AND yearID=17

SELECT *,SUM(shuliang) FROM smokemommon WHERE yearID=17 GROUP BY yanming,leixing,yearID HAVING yearID=17

INSERT INTO smokecommonsum(YEAR,yearID,yanming,shuliang,danjia,guige,baozhuang,leixing)
SELECT YEAR,yearID,yanming,SUM(shuliang),danjia,guige,baozhuang,leixing FROM smokemommon
GROUP BY yanming,leixing

INSERT INTO USER(userID,userName,cooperate,TYPE) SELECT userID,userName,cooperate,TYPE FROM USER WHERE userID=222

DELETE FROM smokecommonsum WHERE yearID=17

SELECT * FROM smokecommonSum WHERE yearID=17

DELETE FROM smokemommon WHERE yearID<>17

DELETE FROM smokemommon WHERE yearID=17

DELETE FROM smokecommonSum WHERE (yanming,leixing) IN (SELECT yanming,leixing FROM smokecommonsum GROUP BY yanming,leixing HAVING COUNT(*)>1)
AND rowid NOT IN


smokemommon

UPDATE smokemommon SET shuliang=4 WHERE yanming=‘中南海(硬94mm浪漫风情)‘ AND leixing=‘真品卷烟‘ AND yearID=17 AND YEAR=2015

这些~~~

标签:

原文地址:http://www.cnblogs.com/LuoXiaoTing604404828/p/4842591.html

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