|
-
Sorry I didn't really understand your reply..
I was trying to simplify the problem the actual code I am using is
select TS,
Seg_Owner,
Seg_Name,
Seg_Type,
Blocks,
MAX_EXTENTS,
lastweek,
today,
today-lastweek change
from ( select TS,
Seg_Owner,
Seg_Name,
Seg_Type,
Blocks,
MAX_EXTENTS,
MAX(DECODE( trunc(sysdate)- Check_Date,7,
extents, 8, extents, 9, extents, 10, extents, 11,
extents, 12, extents, 13, extents, NULL)) LastWeek,
MAX(DECODE( trunc(sysdate)-Check_Date, 0, extents,
1, extents, 2, extents, 3, extents, 4, extents, 5,
extents, 6, extents, NULL)) Today
from &tablename
where extents >= 50
group by TS, Seg_Owner, Seg_Name, Seg_Type, Blocks, MAX_EXTENTS)
The data in the table is input on a weekly basis (pulled from the data dictionary, I want to find the stats for "This week, Last week and the difference.
When I run this script I get the following output
TS SEG_OWNER SEG_NAME SEG_TYPE BLOCKS MAX_EXTENTS LASTWEEK TODAY CHANGE
---------- ---------- ---------------------- -------- -------- -------------- -------- ---------- --
USER_DATA BSEC1 AUDIT_MARKET_TRACKING TABLE 17,420 2,147,483,645
USER_DATA BSEC1 AUDIT_MARKET_TRACKING TABLE 17,810 2,147,483,645
USER_DATA BSEC1 AUDIT_MARKET_TRACKING TABLE 18,850 2,147,483,645
USER_DATA BSEC1 AUDIT_MARKET_TRACKING TABLE 19,370 2,147,483,645
USER_DATA BSEC1 AUDIT_MARKET_TRACKING TABLE 19,630 2,147,483,645
USER_DATA BSEC1 AUDIT_MARKET_TRACKING TABLE 20,150 2,147,483,645 152 152 0
The only information I want is the bottom row - the rest is historical data from previous week's and months.
Hope this clears up what I'm looking for.
Many thanks for your reply
Alison
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|