How can I convert scattered data in Oracle table to monthly data using Oracle View?

How can I convert scattered data in Oracle table to monthly data using Oracle View?
Mohammed DallagPetroleum ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
could you please clarify what you have as "input" and what you need as "output"?
I presume you want to build a sql with GROUP BY , but without some clear "specs" it will be impossible to provide more "answer"
0
MikeOM_DBACommented:
You could always "aggregate" this data by month.
:p
0
Geert GOracle dbaCommented:
i deduced this sql from your description:

create oracle_view as
select
  grouped_column_1, grouped_column_2,
  to_char(date_column, 'yyyymm') year_month,
  sum(quantity) summed_quantity,
  count(entries) num_entries
from oracle_table
group by grouped_column_1, grouped_column_2,
  to_char(date_column, 'yyyymm')

it's possible this sql gives a "column does not exist" error

the use
select * from oracle_view
to see the data
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mohammed DallagPetroleum ConsultantAuthor Commented:
I will test youe solution and let you know
0
MikeOM_DBACommented:
You could learn all about "aggregate" functions by Reading The Fine Manual:

Oracle® Database SQL Language Reference
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.