아래의 쿼리 SQL-오라클 그룹화 결과 행
Select
trunc(create_dtime) as Day,count(create_dtime) as DLs
From Player_Tapjoy
Where
Trunc(Create_Dtime) >= To_Date('2012-sep-01','yyyy-mon-dd')
And Trunc(Create_Dtime) < To_Date('2012-sep-03','yyyy-mon-dd')
Group by trunc(create_dtime)
Union All
Select trunc(create_dtime) as Day,
Count(Create_Dtime) As DLs
From Player_aux_pt
Where
Site = 'AppCircle' And
Trunc(Create_Dtime) >= To_Date('2012-sep-01','yyyy-mon-dd')
And Trunc(Create_Dtime) < To_Date('2012-sep-03','yyyy-mon-dd')
Group By Trunc(Create_Dtime)
나에게 다음과 같은 결과 제공합니다 :
Day DLs
02-Sep-12 6920
01-Sep-12 6630
02-Sep-12 3009
01-Sep-12 3637
나는 매일이 하나 개의 행이되도록 이러한 결합 할 수 있습니다 방법을, 그리고 그것이 올바르게 주문 했습니까?
내 눈이 그 들여 쓰기로 피를 흘 렸습니다. – Roger
@ 로저 당신이 무슨 뜻인지 이해가 안됩니다. 내 검색어가 너무 길어서 유용하지 않습니까? – Americo
그는 코드를 형식화 한 방식이 마음에 들지 않는다는 것을 의미합니다. 두 쿼리 간의 차별화는 어렵습니다. 자주 사용되는 SQL 형식 표준 (http://stackoverflow.com/questions/519876/sql-formatting-standards) –