Select date, optional field 1, optional field 2, sum (type 1) Type 1, sum (Type 2) Type 2, sum (Type 3) Type 3, sum (Type 4) type 4, sum (type 5) type 5, sum (Type 6) type 6 from (selectto_date (to_char (date, yyyy-mm-dd), yyyy-mm-dd) date, optional field 1, optional field 2, count (primary key field) select date, optional field 1, optional field 2, sum (type 1) Type 1, sum (Type 2) type 2, sum (Type 3) Type 3, sum (Type 4) type 4, sum (type 5) type 5, sum (Type 6) type 6 from (
Select to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd') date, optional field 1, optional field 2, count (primary key field) type 1, 0 type 2, 0 Type 3, 0 type 4, 0 type 5, 0 type 6 from Table Name
Where 1 = 1
Group by to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd'), optional field 1, optional field 2
Union all
Select to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd') date, optional field 1, optional field 2, 0 Type 1, count (primary key field) Type 2, 0 Type 3, 0 type 4, 0 type 5, 0 type 6 from Table Name
Where 1 = 1
Group by to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd'), optional field 1, optional field 2
Union all
Select to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd') date, optional field 1, optional field type 2, 0 Type 1, 0 type 2, count (primary key field) Type 3, 0 type 4, 0 type 5, 0 type 6 from Table Name
Where 1 = 1
Group by to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd'), optional field 1, optional field 2
Union all
Select to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd') date, optional field 1, optional field type 2, 0 Type 1, 0 type 2, 0 Type 3, count (primary key field) type 4, 0 type 5, 0 type 6 from Table Name
Where 1 = 1
Group by to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd'), optional field 1, optional field 2
Union all
Select to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd') date, optional field 1, optional field type 2, 0 Type 1, 0 type 2, 0 Type 3, 0 type 4, count (primary key field) type 5, 0 type 6 from Table Name
Where 1 = 1
Group by to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd'), optional field 1, optional field 2
Union all
Select to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd') date, optional field 1, optional field type 2, 0 Type 1, 0 type 2, 0 Type 3, 0 type 4, 0 type 5, count (primary key field) type 6 from Table Name
Where 1 = 1
Group by to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd'), select Field 1, select Field 2) where 1 = 1 group by to_date (to_char (date, 'yyyy-mm-dd'), 'yyyy-mm-dd'), optional field 1, optional field 2
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.