急SQL语句

WBOY
Release: 2016-06-13 13:28:28
Original
893 people have browsed it

急求一个SQL语句
id only date in out c2  
3005 131 20120604 2 0 0 
3004 184 20120604 1 0 0 
3003 131 20120605 2 6 4 
3002 180 20120605 1 0 0 
3001 257 20120606 2 0 3 
3000 131 20120606 2 0 2 


表是这样的 date是每一天的日期 想做一个SQL语句 就是 查询出来 3天内 这三天C2一共加起来小于5的 的所有ONLY的集合

------解决方案--------------------
这样写会报错:Unknown column 's' in 'where clause'

SQL code

SELECT `only`,SUM(`c2`) AS s FROM test_csdb2 
WHERE s
                 
              
              
        
            
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template