Urgent SQL statement

Source: Internet
Author: User
An SQL statement: idonlydateinoutc2 & nbsp; 300513120120604200 & nbsp; 3004184201206 an SQL statement is urgently required.
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


The table is such a date, which is the date of each day. to create an SQL statement, you can query all the ONLY sets of less than 5 for C2 in the three days.

------ Solution --------------------
In this case, the following error occurs: Unknown column's 'in 'where clause'
SQL code
SELECT 'only', SUM ('C2 ') AS s FROM test_csdb2 WHERE s <5 AND 'date' BETWEEN 20120603 AND 20120605 group by 'only ';

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.