2017-01-11 2 views
-4

日付がyyyymmddの表があります。私は月と通知タイプに基づいてレポートを抽出したいと思います。オラクル・コードから月単位でデータを集める

Below is the input

以下の期待出力されます。

Expected output

お聞かせください。 SQLを使用してこれをどのように実現できますか?

+1

http://stackoverflow.com/help/how-to-ask – sasquatch

+0

http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on -so-when-asking-a-question/285557#285557 –

答えて

0

このようなものが動作します。

select to_number(substr(date, 5, 2)) month 
, notiftype 
, count(*) 
from yourTable 
group by to_number(substr(date, 5, 2)), notiftype 

しかし、今年せずに月を選択することはめったに良いアイデアではありません。

+0

**ありがとうございました!** :) –

関連する問題