SQL Language (MOSC)

MOSC Banner

grouping sets

edited Feb 18, 2010 5:03AM in SQL Language (MOSC) 12 commentsAnswered
 I'm creating a Materialized View which uses UNION ALL.  The unions are needed in order to populate data at a specific period of time AND earlier.  To reduce the coding and improve performance, I want to use grouping sets instead.  I haven't been able to get grouping sets to work so that I have only one query.  This is the test code query with UNION ALL:

SELECT

a.month_end, b.clinic ,b.patient_id,sum(b.payment)

FROM month_end_list a, patient b

WHERE trunc(a.month_end) =  '31-MAR-2008'

and b.accounting_month <= a.month_end

group by a.month_end,b.clinic,b.patient_id

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center