What is the best solution to this problem?
I have so many solutions in mind right now but i am looking for the best solution if possible. i have the following query
SELECT one_query.date_required as Month_id,
nvl(one_query.amount_used, 0) as overalluserhours_A,
nvl(second_query.amount_used_b, 0) as overalluserhours_B,
nvl((trunc(((second_query.amount_used_b/one_query.amount_used) * 100), 2)), 0) as p_change
from
(select to_char(b1.needed_date,'YYYY-MM') as date_required,
SUM(b1.amount_used) as amount_used,
b1.type_id as type_id
from table_one b1
where b1.zone_type like 'NEWYORK%'
and b1.type_id = 'CARS'
and trunc(b1.needed_date) between to_date('2009-01-01', 'YYYY-MM-DD') and to_date('2009-12-31', 'YYYY-MM-DD')
group by to_char(b1.needed_date,'YYYY-MM'), b1.type_id) one_query,
(select to_char(b2.needed_date, 'YYYY-MM') as date_required,
SUM(b2.amount_used) as amount_used_b,
b2.type_id as type_id
from table_one b2
where b2.zone_type like
'CHICAGO%'
and b2.type_id = 'BIKES'
and trunc(b2.needed_date) between to_date('2009-01-01', 'YYYY-MM-DD') and to_date('2009-12-31', 'YYYY-MM-DD')
group by to_char(b2.needed_date, 'YYYY-MM'), b2.type_id)second_query
where one_query.date_required = second_query.date_required(+);the above query is being used on table_one. The current problem I am having is based on the fact that table_one might sometimes contain data for only chicago and not for newyork. in this case, table_one would look like this
identification_id needed_date zone_type type_id
2 3/22/2006 12:00:00 CHICAGO BIKES
3 2/12/2006 12:00:00 CHICAGO BIKEShowever though, in other case, it could be the other way around. in this case, table_one will look like this
identification_id needed_date zone_type type_id
4 4/21/2007 12:00:00 NEWYORK CARS
5 1/12/2007 12:00:00 NEWYORK CARS
and finally table_one could contain information for both cases. hence, we could have the following situation
identification_id needed_date zone_type type_id
6 6/21/2008 12:00:00 NEWYORK BIKES
7 8/12/2008 12:00:00 CHICAGO CARSKindly note, my above query is currently being used inside a function. I know I can write so many if statement to handle but the main issue is regarding the fact, i am also using that query in another query which performs so many union all.
I'm not sure how you're going to parameterize it, how those filters change from call to call, but an idea would be something like this:
select date_required month_id,
max(amt_used_chicago_bikes) overalluserhours_A,
max(amt_used_newyork_cars) overalluserhours_B,
(max(amt_used_chicago_bikes) / max(amt_used_newyork_cars)) * 100 p_change
from (select zone_type,
to_char(b1.needed_date, 'YYYY-MM') as date_required,
b1.type_id as type_id,
SUM(case when zone_type like 'CHICAGO%' and type_id = 'BIKES'
then b1.amount_used end) as amt_used_chicago_bikes,
SUM(case when zone_type like 'NEWYORK%' and type_id = 'CARS'
then b1.amount_used end) as amt_used_newyork_cars
from table_one b1
where trunc(b1.needed_date) between
to_date('2009-01-01', 'YYYY-MM-DD') and
to_date('2009-12-31', 'YYYY-MM-DD')
group by b1.zone_type,
to_char(b1.needed_date, 'YYYY-MM'),
b1.type_id)
where amt_used_chicago_bikes is not null or amt_used_newyork_cars is not null
group by date_required;Again, this is not the biggest concern regarding performance and certainly not the best way of doing it. Cracking those 250 lines of SQL and making it optimized would probably be the best way to approach the issue here.
Similar Messages
-
Help Me.
What is the best solution for this problem ?Encore is activated when you activate Premiere Pro... so, as Stan asked, how did you install P-Pro?
Ask for serial number http://forums.adobe.com/thread/1234635 has a FAQ link
-and a fix for Encore http://forums.adobe.com/thread/1421765?tstart=0 in reply #7
-plus more Encore http://helpx.adobe.com/encore/kb/cant-write-image-fie-larger1.html -
I have iphone 5, after upgrading it to iOS7, front is working find unfortunately rear camera became blurred, what is the best way to fix this? Looking forward to the best solution of this problem.
WORKAROUND FOUND ! Download and install "Awesome Camera" app and take a picture with that app. After 1-2 seconds of standby, it will work. Then you can go back to default Camera app which would work again.Please let me know
-
My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know what option would be the best solution for this problem?
You appear to have two issues: 1) a hard drive that is not working properly and 2) files you wish to recover.
Re 1) you need to answer Kappy's questions.
Re 2) does the drive load and can you see your photo files? If so can you copy them to another drive?
Do you not have a backup of the photo files? -
Migrated Aperture 3 upgrade from old Mac Book Pro to new Mac Book Pro. Can't open Aperture on new machine because I don't have the original serial number for Aperture 2 program originally installed on the old machine. What is the best solution to this situation
Call Apple and make a appointment.
You have 3 months of care and up to 3 years with paid AppleCare, let them handle it and bring everything in.
Good Luck -
Coalesce or compress this index? what is the best solution in this case?
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64biI have executed the following query on a specific index that I suspected to be smashed and got the following result
select
keys_per_leaf, count(*) blocks
from (
select sys_op_lbid (154813, 'L', jus.rowid) block_id,
count (*) keys_per_leaf
from xxx_table jus
where jus.id is not null
or jus.dat is not null
group by sys_op_lbid (154813, 'L', jus.rowid)
group by keys_per_leaf
order by keys_per_leaf;
keys_per_leaf blocks
1 80
2 1108
3 2816
4 3444
5 3512
6 2891
7 2579
8 2154
9 1943
10 1287
11 1222
12 1011
13 822
14 711
15 544
16 508
17 414
18 455
19 425
20 417
21 338
22 337
23 327
24 288
25 267
26 295
27 281
28 266
29 249
30 255
31 237
32 259
33 257
34 232
35 211
36 209
37 204
38 216
39 189
40 194
41 187
42 200
43 183
44 167
45 186
46 179
47 179
48 179
49 171
50 164
51 174
52 157
53 181
54 192
55 178
56 162
57 155
58 160
59 153
60 151
61 133
62 177
63 156
64 167
65 162
66 171
67 154
68 162
69 163
70 153
71 189
72 166
73 164
74 142
75 177
76 148
77 161
78 164
79 133
80 158
81 176
82 189
83 347
84 369
85 239
86 239
87 224
88 227
89 214
90 190
91 230
92 229
93 377
94 276
95 196
96 218
97 217
98 227
99 230
100 251
101 266
102 298
103 276
104 288
105 638
106 1134
107 1152
229 1
230 1 This is a 5 columns unique key index on (id number, dat date, id2 number, dat2 date type number).
Furthermore, a space analysis of this index using dbms_space.space_usage gives the following picture
Number of blocks with at least 0 to 25% free space = 0 -------> total bytes = 0
Number of blocks with at least 25-50% free space = 75 -------> total bytes = ,5859375
Number of Blocks with with at least 50 to 75% free space = 0 -------> Total Bytes = 0
number of blocks with at least 75 to 100% free space = 0 -------> total bytes = 0
Number of full blocks with no free space = 99848 -------> total bytes = 780,0625
Total blocks ______________________________
99923
Total size MB______________________________
799,384It seems for me that this index needs to be either coalesced or compressed.
Then, what would be the best option in your opinion?
Thanks in advance
Mohamed Houri
Edited by: Mohamed Houri on 12-janv.-2011 1:18So let me continue my case
I first compressed the index as follows
alter index my_index rebuild compress 2;which immediately presents two new situations
(a) index space
Number of blocks with at least 0 to 25% free space = 0 -------> total bytes = 0
Number of blocks with at least 25-50% free space = 40 -------> total bytes =, 3125
Number of Blocks with at least 50 to 75% free space = 0 -------> total Bytes = 0
Number of blocks with at least 75 to 100% free space = 0 -------> total bytes = 0
Number of full blocks with no free space = 32361 -------> total bytes = 252, 8203125
Total blocks ______________________________
32401
Total size Mb______________________________
259,208meaning that the compress command freed up 67487 leaf blocks and reduced the size of the index from to 799,384 MB to 259,208 MB.
It also shows a relative nice pictue of number of keys per leaf block (when compared to the previous situation)
(b) on the number of key per leaf block
KEYS_PER_LEAF BLOCKS
4 1
6 1
13 1
15 1
25 1
62 1
63 1
88 1
97 1
122 1
123 3
124 6
125 4
126 2
289 4489
290 3887
291 3129
292 2273
293 1528
294 913
295 442
296 152
297 50
298 7
299 1 In a second step, I have coalesced the index as follows
alter index my_index coalesce;which produces the new figure
Number of blocks with at least 0 to 25% free space = 0 -------> total bytes = 0
Number of blocks with at least 25-50% free space = 298 -------> total bytes = 2,328125
Number of Blocks with at least 50 to 75% free space = 0 -------> Total Bytes = 0
Number of blocks with at least 75 to 100% free space = 0 -------> total bytes = 0
Number of full blocks with no free space = 32375 -------> total bytes = 252, 9296875
Total blocks ______________________________
32673
Total size MB______________________________
261,384meaning the the coalesce command has made
(a) 298-40 = 258 new blocks with 25-50% of free space
(b) 32375-32361 = 14 new additional blocks which have been made full
(c) The size of the index increased by 2,176MB (261,384-259,208)
While the number of key per leaf block keeps in the same situation
KEYS_PER_LEAF BLOCKS
4 2
5 3
9 1
10 2
12 1
13 1
19 1
31 1
37 1
61 1
63 1
73 1
85 1
88 1
122 1
123 4
124 4
125 3
126 1
289 4492
290 3887
291 3125
292 2273
293 1525
294 913
295 441
296 152
297 50
298 7
299 1 Could you please through some light on the difference between the compress and the coalesce on the effect they have made on
(a) the number of keys per leaf blocks within my index
(b) the space and size of my index?
Best regards
Mohamed Houri -
Is an array the best solution for this problem?
Hi there,
I'm working up a demo where a couple of little games would show up in a panel. There is a main menu that you bounce around to select things (the games as well as other apps.)
When a single game is running, it takes up the whole panel. When two or more are running, they run in a "mini" format. Also, when a game is running, a special "return to game" button appears in the main menu.
This is a click through dog and pony show demo. It's not a production app, but it has to work well enough to be played around with by internal clients. So it has to work well.
Right now I have some variables set up like so:
var gameActive:Boolean = false;
var gameDual:Boolean = false;
In my launch game and menu function, I am checking these (and one or two other) variables to see if I should do things like show a mini version of the game or show the return to game button. As I add features though, this is becoming slightly unwieldy.
The key issue is the games. Let's say I have only two. I could make an array, and then load in the game name when a game is launched. I could check this array in my functions to see not only if games are launched, but which game is launched so I can use the full or mini games as appropriate.
Is this a good approach, or is there a better way? I'm rusty with my coding and not super comfortable making objects right now. But I could go that way if it was the best.there's not much to it. here are the only 3 things you're likely to need to do with your associative array:
var yourAA:Object={};
function addAAItem(aa:Object,o:DisplayObject){
aa[o.name]=o;
function removeAAItem(aa:Object,o:DisplayObject{
aa[o.name]=null;
function aaLength(aa:Object):int{
var i:int=0;
for(var s:String in aa){
i++;
return i; -
As i was using my iPhone, it suddenly shut off without being shut off by anyone.i tried to turn my iPhone back on several times and nothing has worked. what could be the problem?
Does it, instead of powering up, show a little battery icon almost empty and a plug icon next to it? In that case it needs recharging to have enough power to start up again. Even if it doesn't, try connecting it to a power source and see what happens. If it doesn't respond there you may need to bring it in for repair.
-bb -
What is the best solution to the earphones problem?? (Ipod shuffle 3rd gen)
Hey guys,
at the end of the day what is the best solution for that problem with the earphones of the new Ipod shuffle? After do some reading through the forums i came up with a couple of solutions that i could probably choose but i am creating that topic as i would like to hear more about your opinions - suggestions.
The first one of the solutions i thought is that i should go and buy one of these..
http://www.amazon.co.uk/Scosche-tapSTICK-IRMC-Controls-Shuffle/dp/B002CVTU5Q/ref =wlit_dpo?ie=UTF8&coliid=I10ZELYHA99O08&colid=2OIMEI23BWJ9Z
What do you guys thing about that? Is that one of the effective solutions?
And the other option that i was considering is to buy one of this:
http://www.amazon.co.uk/Scosche-IRM35-tapLINE-Control-Headphone/dp/B002CVTU56/re f=wlit_dpo?ie=UTF8&coliid=I2TP2KR5MGFSTJ&colid=2OIMEI23BWJ9Z
What do you guys thing about that? Is that one of the effective solutions?
Well i am looking forward for your replies!!
Just to let you know i wouldn't consider the glue/tape solution as one of my final choices as in my opinion that is not so good to look at and on the other hand who would like to spend his/hers money to buy something good and then you pour glue on it!! Anyway, to finish, buying a 2nd generation Ipod Shuffle is still one of my solutions to that problem, what do you thing is best for me?
RegardsHey there, first of all let me thank you for your help and advice!!
furthermore, as i am intending to use my devise in my car as well by using an fm transmitter
(something like that one: http://www.griffintechnology.com/products/itrip-auto-universal-plus)ALWAYS BEARING IN MIND APPLE'S TWO HUGE MISTAKES:
1)the controls are on the earphones so i would also need to have one of this http://www.amazon.co.uk/Scosche-tapSTICK-IRMC-Controls-Shuffle/dp/B002CVTU5Q/ref =wlit_dpo?ie=UTF8&coliid=I10ZELYHA99O08&colid=2OIMEI23BWJ9Z (WHAT A MISTAKE!!)
AND 2)the purchase of one of these tapSTICKs in addition to a new pair of earphones is needed due to that moisture - sweat problem right?
So what do you guys suggest to me as the best solution to use my ipod in the gym (with all that moisture and sweat!) as well as using it in the car while having the option to change song?
Thank you in advance! -
[Sales/Shipment report] - What's the best solution?
Hello everybody.
I have to develop a report with some sales data, delivery service data and shipment costs data.
I have the cubes: 0SD_C03, 0SD_C04, 0LES_C02.. and I thought to do a multicube, but I don't no how to link these cubes...
I don't have, for example, Sales Document/Item and/or Delivery Document/Item in all os these cubes...
What is the best solution to this sittuation?
I thought in some solutions like...
1 - Extend extractor of 0LES_C02 to include Sales Doc/Item, but I don't know if all delivery doc is related to a sales doc.
2 - I know I have all the fields that I want in the tables VBAP and LIPS...so I thought in create an generic extractor with a view of these two tables, and than creat a Z cube, to receive these datas...
I really don't know whats the best solution, or if there is abother solution to this....
I'll apreciate ideas, or a solution from someone that already face with this and developed a solution.
Best Regards,
ThiagoHi,
Its better for you to add sales order,item in the cubes also from the source where your cube gets data ie from DSO as they are only point through which you can combine sales,delivery and billing data.
Thanks,
Arun -
I have three iPhone 4 models purchased in late 2010 (for my family) that all share the same iTunes account for access to apps and music, but each phone/user still has his/her custom contact list, email accts, and select lists of apps and music from the one iTunes acct library. The problem is I can only update the software on one of the three iPhones – the primary phone I used to setup the iTunes acct. What is the best solution to manage these devices for software updates, apps? This is probably a common problem with families wanting to share apps and music without realizing the issues created by this approach. As it stands today... the first (primary) iPhone associated with the iTune acct has been updated with the latest software version 5.1.1 and sync'd up with all the apps, music, etc from the one iTune acct, while the other two iPhones are still running on the original software version 4.0.2 and are experiencing problems now. I was advised by AT&T back in January that it would be necessary to setup separate iTunes accts for the second and third iPhones in order to receive system updates. The problem would be how to keep all the apps, etc from being deleted off the second and third phones that were originally loaded from the one iTunes acct. Since this AT&T advice was prior to iCloud coming out, would iCloud be a better solution or at least part of the solution? I really don't yet understand how iCloud works. Hopefully, someone out there can help me?? Please?
I have three iPhone 4 models purchased in late 2010 (for my family) that all share the same iTunes account for access to apps and music, but each phone/user still has his/her custom contact list, email accts, and select lists of apps and music from the one iTunes acct library. The problem is I can only update the software on one of the three iPhones – the primary phone I used to setup the iTunes acct. What is the best solution to manage these devices for software updates, apps? This is probably a common problem with families wanting to share apps and music without realizing the issues created by this approach. As it stands today... the first (primary) iPhone associated with the iTune acct has been updated with the latest software version 5.1.1 and sync'd up with all the apps, music, etc from the one iTune acct, while the other two iPhones are still running on the original software version 4.0.2 and are experiencing problems now. I was advised by AT&T back in January that it would be necessary to setup separate iTunes accts for the second and third iPhones in order to receive system updates. The problem would be how to keep all the apps, etc from being deleted off the second and third phones that were originally loaded from the one iTunes acct. Since this AT&T advice was prior to iCloud coming out, would iCloud be a better solution or at least part of the solution? I really don't yet understand how iCloud works. Hopefully, someone out there can help me?? Please?
-
What is teh best solution for my Problem??
hello everyone
i'am planing to develop a Patient Management System (PMS)
since i 'm not that guru in the J technologies i would like you to get me some help with this decision:
what is the best solution for developeing an intranet "PMS" which should handles data (connection to postgresql) and runs some algorithm (for planing puropose) im background ??
1 developeing a web based solution (servlet and jsp and and ..)
2 developeing an application wich will be manging everything ??? (a kind of programm with its own GUI)
3 you may have an other idea solution and ill be gald for any advices
ps sorry for my english its not that great ;)Web applications are all the rage these days and IMO rightly so as they greatly reduce deployment cost and headaches.
They do have some drawbacks though which for you might be important.
I can imagine that sooner or later (probably sooner in my experience) a requirement to interface with hardware installed on the client machines will emerge.
Whether this is a barcode scanner or a chipcard reader to get client information from some form of card issued to the client, or maybe a label printer to print out labels for medication bottles doesn't matter, you need to access the client machine directly.
Web applications have great difficulty with that (in fact, it's all but impossible).
You could go for an applet solution but that's contrived at best and still leaves the same problems.
So in your situation an old-fashioned client/server application (maybe using web services to communicate with the serverside application) is likely the best longterm solution.
You'd have the database remote so everyone has access to the same data, being accessed through processes run on the server and called by the clients. These can also do most of the business logic, leaving the clients relatively dumb responsible mainly for data validation and entry and presentation of the results. -
Many times my computer takes too long to connect to new website. I have wireless internet (time capsule) and I am running a pretty powerful real time financial work program at same time, what is the best solution? Upgrading speed from cable network? is it a hard drive issue? do I only need to "clean out" the computer? Or all of the above...not to computer saavy. It is a Macbook Pro osx 10.6.8 (late 2010).
Almost certainly none of the above! Try each of the following in this order:
Select 'Reset Safari' from the Safari menu.
Close down Safari; move <home>/Library/Caches/com.apple.Safari/Cache.db to the trash; restart Safari.
Change the DNS servers in your network settings to use the OpenDNS servers: 208.67.222.222 and 208.67.220.220
Turn off DNS pre-fetching by entering the following command in Terminal and restarting Safari:
defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false -
What is the best solution to create the business partners in CRM?
Hi all,
I need to migrate the business partners (general data, address, marketing attributes ) in CRM from an excel file
What is the best solution to create the business partners with these informations?
I tried LSMW but to enter the SALES and MARKETING atributes in BP i have to "click" on the attribute and not realized by the record.
Thanks in advance
best regard
miguelHi Miguel,
Always preferred to use XIF Function Modules to create Business Partners and Relationships.
CRMXIF_PARTNER_SAVE
CRMXIF_PARTNER_REL_SAVE
Using this function modules you can populate all most all fields in BP including Z fields(If it created through EEWB), except Marketing Attributes.
For marketing attributes try to use FM CRM_MKTBP_CREATE_LIST_BPS_OB.
Have a look at the notes 609236, 1081545 and 1239018. This will give you some idea, how to upload and update marketing attributes.
//PBP -
What is the best solution for running windows based programs
I have one program that I need windows for. What is the best solution for doing this without painfully slowing down my mac.
Depends on your needs.
BootCamp requires reboot and uses all physical resources of the system. Only OSX *or* Windows can run. Better for gaming or memory intensive tasks. BootCampAssistant must set up the boot sector to make it work. Also BCA required to remove it.
VM (virtual machine) like Parallels which "hosts" Windows while still running OSX. You split RAM between the two environments. VM is just another program so no special boot sector changes needed, but not good for graphics or RAM intensive programs.
Other recommended alternates to Parallels (paid) are VM Fusion (paid) and VirtualBox (free download from Oracle.com).
Maybe you are looking for
-
IPod Touch 4G "charging is not supported with this accessory"
My iPod Touch 4g has been getting the message "charging is not supported with this accessory" ever since iOS 5, and I just recently updated to iOS 6. I currently use an Apple brand charging cord and a 3rd party charging cord, and none of them work. I
-
Thanks for any help. I'm using an HP LaserJet M1536dnf MFP. It is networked wirelessly via an Apple Extreme and prints just fine over the network but will not scan. Yet, it scans just fine when I move the printer's USB cable from the Extreme direct
-
0FISCPER3 - Default to last closed period in Report Variable
Hi all, We have a requirement in our reports to default the Posting Period to last closed period. In the InfoCube we have 0CALMONTH (In Period) and also 0FISCPER3 (Posting Period). The values for Posting Period varies from 1 to 16. What is the functi
-
JAXB as standard API for Java Mappings in XI?
Hi there, Has anyone on this forum implemented Java mappings in XI using JAXB (reference implementation for XML/JAVA data bindings of SUN)? If Yes, can you please share any experiences? We're considering to use this API for Java Mappings in XI but fi
-
"Could not complete Music Store request"
When I enter the Music Store I get this error message - "Could not complete Music Store request". When I log in I then receive the message "Your billing information has changed, please approve. Edit pay screen comes up for approval but I can not ente