Do you know how to decode a date?
HI,I need to count students group by their region on each month. The output is
COUNTRY OCT NOV DEC .....
USA 5 20 30
CAN 100 1 0
MEX 10 20 30
The date format is 5/19/2007
This is my code: and thanks for your help
WITH Q AS (SELECT DISTINCT A.STDID, A.NUMBER, A.ADMIT
FROM PROG A
JOIN CITIZEN B ON A.STDID = B.STDID
JOIN REGION_TBL C ON C.REGION = B.REGION
AND A.NUMBER = 'PS'
AND A.ADMIT IN ('2007','2008'))
SELECT J.REGION, I.DESCR,
SUM(DECODE(L.DATE, '9', 1, 0)) SEP_TOTAL,
SUM(DECODE(L.DATE, '10', 1, 0)) OCT_TOTAL,
SUM(DECODE(L.DATE, '11', 1, 0)) NOV_TOTAL,
SUM(DECODE(L.DATE, '12', 1, 0)) DEC_TOTAL,
SUM(DECODE(L.DATE, '1', 1, 0)) JAN_TOTAL,
SUM(DECODE(L.DATE, '2', 1, 0)) FEB_TOTAL
SUM(DECODE(L.DATE, '3', 1, 0)) MAR_TOTAL,
SUM(DECODE(L.DATE, '4', 1, 0)) ARL_TOTAL,
SUM(DECODE(L.DATE, '5', 1, 0)) MAY_TOTAL,
SUM(DECODE(L.DATE, '6', 1, 0)) JUN_TOTAL,
SUM(DECODE(L.DATE, '7', 1, 0)) JUL_TOTAL,
SUM(DECODE(L.DATE, '8', 1, 0)) AUG_TOTAL
FROM CITIZEN J
JOIN PROG L ON J.STDID = L.STDID
JOIN Q ON J.STDID = Q.STDID
AND Q.NUMBER = J.NUMBER
GROUP BY J.REGION, I.DESCR
...
I think you have to take out the 'MM' part of the date to compare in the decode. By the way, PROG.DATE is really a column name? DATE is a reserved word.
SQL> create table sample1(date date)
2 /
create table sample1(date date)
ERROR at line 1:
ORA-00904: : invalid identifier
SQL> You need to use to_char() to get the month part of the date and then compare it in the DECODE.
Cheers
Sarma.
Similar Messages
-
I accidentally ran my iPhone over and can't afford another one for a few weeks. Until then I need to find a way to extract the data from my last backup in itunes. I can either put it on my computer or I've set up a cloud account that I was hoping could open it. So far I haven't had any luck with either. if anyone can help me out. I would love to get my pictures/videos, messages and contacts off there. The rest I don't care so much about. If someone could let me know if this is possible I would apprciate it!
Thanks. I messed up with my husbands iphone because I was told the wrong thing. Now everytime I sync his phone it makes it look just like the other phone I had. Do you know how I can fix taht for his phone? Any settings I can turn off that will prevent all of my apps/contacts, etc from auto populating his phone?
-
Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.?
I don't know if I'm asking this all in a way that can be understood? Thanks ED3K, however that part I do understand (in the link you provided!)
What I need to know is "how" I can separate or rather create another Apple ID for my son-who is currently using "my Apple ID?" If there is a way to let him keep "all" his info on his phone (eg-contacts, music, app's, etc.) without doing a "reset?') Somehow I need to go into his phone's setting-create a new Apple ID and possibly a new password so he can still use our combined iCloud & Itunes account?
Also then letting me take back my Apple ID & password, but again allowing us (my son and I) to use the same iCloud & Itunes account? Does that make more sense??? I'm sincerely trying to get this cleared up once and for all----just need guidance from someone who has a true understanding of the whole Apple iCloud/Itunes system!
Thanks again for "anyone" that can help me!!! -
Do you know how to sort all except one column?
I implement the Comparator interface tosort the rows in my table.
The last row is a totals row which i want to keep at the bottom always.
Do you know how to do that?
Thanks,
ZekeHow can I do that without making the data look funny?
My Comparator class has a compare method that takes
the two Objects that make up the table data to compare
them. It looks for column that was picked for sorting and
compares the values. Some of the columns contain String
data and some contain Double data.
So for example if I am comparing two Doubles and one of
them happens to be the value for the totals row how can I
detect this?
Thanks,
Zeke -
and in case my computer is out of 4 years period?? (for just a month) do you know how much it would be cost to replace the board?
If the NVIDIA graphics processor in your MacBook Pro has failed, or fails within four years of the original date of purchase, a repair will be done free of charge, even if your MacBook Pro is out of warranty.
That's what it says, mine did too and was out of date. when Lion killed it.
Don't bother fixing it, it's a 4 year old machine and at it's end of life anyway, something else will just die on it, like the keyboard, the superdrive, the hard drive etc etc.
Wth all the money you'll spend fixing it, you could have a new machine.
Mac' laptops only last aobut 4 years with daily use now. -
Does anyone know how to transfer my data from iphone to my new laptop?
Does anyone know how to transfer my data from iphone to my new laptop?
The iphone is not a storage/backup device.
You need to copy everyhting from your old computer, or your backup copy of your old computer, to your new one. -
I cannot get the keyboard to come up on the ipad mini when in the citrix receiver. Has anyone ran into this and do you know how to fix it?
I am not familiar with Citrix Reciever but is it possible it is open or being used in another open app?
Try quitting all apps then try again.
Quit all apps: Double tap the Home button and swipe the app preview page up for each open app -
Hi, do you know how can I upload inelegible songs from itunes to Icloud. They are songs added from original CDs. Another question would be how can I transfer all the music I have in my Ipod Classic to my Itunes or ICloud as I want to back it up.
Depends on why it's ineligible. If it's under 96 Kpbs, try right-clicking on the file and choosing Create AAC Version. (If you don't see this option, go to iTunes>Preferences, click "Import Settings..." then choose "Import Using: AAC Encoder" and "Setting: iTunes Plus".) Then rescan your library to see if this version will add to iTunes Match. Or, after changing your import setting, just re-import the song to your iTunes library.
If the song is over 200 MB you would have to reduce it's size to make it eligible. -
Dear Apple,
I use the same Apple ID on my iPad mini and my iPhone 5. My iPhone 5 was stolen on may 12, 2013. Do you know how to get it back?Click here for information.
(83340) -
MY mac mini hard drive is failing. I am no longer under warranty. Do you know how much it cost to have Apple replace the hard drive? or How I can replace it myself?
You can do it yourself. I did on my 2009 Mini
http://www.ifixit.com/Device/Mac_Mini
Also, this place sells HSDs and has install videos.
http://eshop.macsales.com/installvideos/ -
I am trying to change my credit card details on Itunes as I have moved to NZ and closed down the credit card in Australia. There is $5 left to pay on the card. It will not let me update my address to NZ or put in my new credit card details. HELP!!!!!
It says I have to provide a credit card in the Australia before I can clear my $5 credit card debt and I have now cancelled my card in Australia and don't have another one!
Do you know how I can change my address to NZ and then change my billing to my new credit card in NZ and pay the $5 bill.
Do I have to shut down my account or reapply to Itunes with a new email address and leave this bill outstanding!! Seems crazy........but cant seem to see any other way around it!Click here and request assistance.
(87754) -
does any one know how to connect itunes up? when i click on store it always says 'itunes could not connect to the store. Make sure your network connection is active and try again.' if you know how to fix tell me please, please! thanx
Work through all the troubleshooting here: iTunes: Advanced iTunes Store troubleshooting
B-rock -
All of my titles, themes and generators seem to be completely missing from Final cut pro x. Do you know how to get them back?
Do you mean that when you click the title browser, for example, nothing is there?
Do you at least see several categories listed in the effects browser?
First make sure that you have nothing typed into the search box (not even spaces).
If you still see nothing, try this in order:
1) Window->Revert to Original Layout
2) Quit FCP X, delete preferences using Preference Manager (a free download from Digital Rebellion)
3) Download FCS Remover, and use it to completely remove FCP X. This will NOT delete your content, just the application.
4) Reinstall FCP X from the Mac App Store: log in with the same Apple ID that you used to buy FCP X, click on "Purchases", locate FCP X and click Install. -
Hi, I have photoshop CC. It's the french version but I would like to have it in english. I went in the creative cloud to change the language but it doesn't seem to work. Do you know how i could do it ?
Please indicate whether or not the following link helps... I have not had to use it and so I do not know if/when it does help.
Creative Cloud Help / Adjust the install language | Creative Cloud applications | CCM -
http://helpx.adobe.com/creative-cloud/kb/change-installed-language.html -
You Are Rad If You Know How To Do This...
Hello My Fellow Flashophiles
So, I will bow down to you if you know how to help me with
this one.
I have a MovieClip in my Flash file which emulates a
signature being drawn by animating a mask that covers over a bit
more of the underlying bitmap (of the actual, static signature)
frame by frame. I'm interested in allowing the color of the static
signature in the bitmap to be set dynamically. Here's the
pseudocode I've come up with so far:
- Access the bitmap in the MovieClip
- Replace (somehow) every black pixel in the bitmap (the
signature is black, the background white) with a pixel that is the
chosen color
- addChild the MovieClip to the main timeline
I am also considering separating the bitmap from the
MovieClip and just setting the MovieClip as its mask
dynamically....
Any ideas on any part of this? You're rad!
Thanks,
GrahamOh! Cbeech is the winner once again... I'm really starting to
owe you, friend. Thanks once again for your invaluable help...
So, yes, I decided it would be best to strip the bitmap out
of the mc. Instead, I load it programmatically, apply the threshold
method (I
knew there had to be such a function! -- thanks, Beech!),
then set the animation as the mask programmatically. Note to
Cbeech: the colors for both the bground and the signature are
selected via the sampling method you helped me with before.
Here's the outcome:
http://www.catherinemix.com/cmix8.html
A lot of work for modest results, but I suppose that's the
name of the game. I'm not complaining, tho. My understanding grows
geometrically, and it's fun!
Be Well,
Graham
Maybe you are looking for
-
Ipod Touch & Mini not recognized by iTunes 5.7
I've been having this problem for a while and haven't seen any real solutions besides the 5 Rs (and they don't fix it). Basically, my ipod touch (1st gen, I believe) and ipod mini (1st gen) are not recognized by iTunes 5.7. I've done the 5 Rs - well,
-
API of Resource object managment - OIM 11g R2
Hi All, I want to provision a resource (say 'AD User') from a post event handler (OIM 11g R2) during user creation. Please tell me the API to be used. In OIM 10g, we can use 'tcObjectOperationsIntf' interface to operate on resource objects. what API
-
When I upgraded to Mavericks the other day, I lost functionality of Mac App Store. It worked fine in Mountain Lion. Please help!
-
How to watch video imported from iphone to imac
I imported a video taken on my iPhone 5, to my iMac's iPhoto. I can see the image of the video in iphoto but nothing happens when I click on it. In other words, how do I play the video? Thanks for any help
-
ZONE configuration steps in solaris 10
Hi Please help me to setup the zone configuration in solaris10 Thanks Abi................................