Noob Needs Help! Please Please Please Help!

MD doing reserach on Genetic Mutations, I really need help on this, I have never used PL/SQL. Can somebody help me with this?
I have a view made of mulitple table that has following columns: diagnosis, patient_id, kindred_id, column_d, colum_e.... column_p where each distinct combination of column_d to column_p means one specific mutation. I want to group patients who have same mutation to find out the following:
for each mutation(unique column d through column p), I want to find out how many families have diagnosis 1, diagnosis 2, diagnosis 3...
The rule is the program will look at kindre_id first, to see if this person's kindre_id has been looked at. If
so, jump it/ignore it. If this kindred_id has never been looked at, treat it as a unique family. Diagnosis count for that diagnosis will then increase by 1. Sounds easy, but I don't know how to write that for loop that will do for each unique (column d, column c, ... column p) do the following... Does such a thing exist?

Hi,
SELECT     diagnosis
,     COUNT (DISTINCT kindred_id)     AS family_cnt
,     column_d
,     column_e
,     column_f
FROM     table_x
GROUP BY     diagnosis
,          column_d
,          column_e
,          column_f
;     produces this output:
DIAGNOSIS FAMILY_CNT COLUMN_D   COLUMN_E   COLUMN_F
         1          2 abc        bca        acb
         2          2 abc        bca        acb
         3          2 abc        bca        acbwhich is the data you want, but not in the format you want. You want to pivot the family_cnt column from the three rows into three columns in one row. For general information about how to this, search for "pivot" on this or similar sites.
One solution is:
SELECT     COUNT (DISTINCT CASE WHEN diagnosis = 1 THEN kindred_id END)     AS diagnosis_1
,     COUNT (DISTINCT CASE WHEN diagnosis = 2 THEN kindred_id END)     AS diagnosis_2
,     COUNT (DISTINCT CASE WHEN diagnosis = 3 THEN kindred_id END)     AS diagnosis_3
,     column_d
,     column_e
,     column_f
FROM     table_x
GROUP BY     column_d
,          column_e
,          column_f
;     which produces the following output:
DIAGNOSIS_1 DIAGNOSIS_2 DIAGNOSIS_3 COLUMN_D   COLUMN_E   COLUMN_F
          2           2           2 abc        bca        acbThis technique assumes that you know exactly how many different diagnoses there are and what the distinct values of the diagnosis column are. (I.e., in this example, I knew that that there were three diagnosie and that their values were 1, 2 and 3. I used that information to write three COUNT expressions, with values 1, 2 and 3 hard-coded into them.)
So, what can you do if you do not know the diagnosis values? The columns have to be hard-coded into the query, so how can you possiblly write something today that will have all the values that are in the table next month? You can't, but you can write something today that you can run (unchanged) next month which will write such a query. In other words, you can do dynamic SQL, where you run a preliminary query to get the different diagnosis values, write an appropriate query similar to the one above, and then run that newly-created query. The PL/SQL command "EXECUTE IMMEDIATE" can help with this.
The code above works in all versions of Oracle. In Oracle 11, there is a more straigtforward way of specifyng PIVOT in a SELECT statement.

Similar Messages

  • Please can you help me to solve my problem  ( I have iphone is linked with Apple ID and I forgot that Apple ID and I can't remember it , I need thats Apple ID to activate my iphone ,,, what should I do ?

    please can you help me to solve my problem  ( I have iphone is linked with Apple ID and I forgot that Apple ID and I can't remember it , I need thats Apple ID to activate my iphone ,,, what should I do ?

    mohammed aljasim wrote:
    there are many people that error is happened with them and one of this people is me ,, Apple must be find the solution for this problem
    You are absolutely WRONG. Apple bears no responsibility in this at all. YOU purchased a STOLEN phone. You are guilty of receiving stolen property at best. Take it back to wherever you bought it and demand a refund. Failing that, turn it over to the police. You got ripped off. I'm sorry you wasted your money, but there is NOTHING Apple or anyone else can do for you. Only the rightful owner of the phone can unlock it.

  • Please can you help....  I ordered an iPhone 5s in early September from the orange shop in Chamonix Mont-Blanc France.  I needed a new phone as i dropped my iPhone and broke it so it thought i would upgrade.  I was asked in the shop if I wanted a black or

    Please can you help....
    I ordered an iPhone 5s in early September from the orange shop in Chamonix Mont-Blanc France.
    I needed a new phone as i dropped my iPhone and broke it so it thought i would upgrade.
    I was asked in the shop if I wanted a black or white one, I asked for a Black one, as all my iPhones have all been Black as I DON'T LIKE White ones. (sorry)
    I was told my phone would arrive in a week so I waited with broken phone for new one. The following week I was told it would be the following week, the following week i was told the same but the assistant in the shop told me they would ring me when it arrived. Three days later i recieved a text from the shop to say the phone would be in tomorrow, when I went in they said it had not arrived and they would call me when it was in the shop.
    They called me on Thursday the 17th of October to say the phone was in the shop.
    I arrived at the shop at 6:00pm after my work, the shop closes at 7:00pm. I recieved the phone, signed for it and extra unwanted insurance with I was told I could only canceled in a month. I was then told they didn't have any sim cards in the shop, i said no problem the Phone i assume will need charging so i will take it home and charge it and return for the sim tomorrow.
    So the Phone remained boxed.
    When I returned home and opened the box I realised it was a white one, I replaced the lid put it back in the bag, and returned it to the shop first thing Friday 18th October, to point out the error, only to be told "to bad" ?? I was told I could have changed it the night before but not this morning? They said I had ordered a Black one but as I had signed for a White one nothing can be done. I was angry and left the shop. I returned later the same day with a French friend to try and resolve this problem, as I wasn't sure if something was being lost in translation. I didn't think I was being unreasonable, it is a very expensive piece of equipment and this wasn't what i wanted. They told my friend that the phone was not available in Black, that was the 5, and that the 5s was only available in silver and gold, and that mine was a silver one.
    I then thought it was my mistake as it was a new phone. She put a sim in the phone put it in the box and I left for a business meeting only to arrive and see a Black iPhone 5s sitting on the table??
    So I then returned back to the shop with the Black one and mine still all boxed and untouched to prove they had blatantly lied to me an hour ago, only to be told that there was nothing they were prepared to do.
    Is this fair practice ? I am at a loss with this and am looking for help ?

    Welcome to the Support Communities. This Apple doc may be of interest:
    Channel Member Code of Conduct
    Kings74 wrote:
    They told my friend that the phone was not available in Black, that was the 5, and that the 5s was only available in silver and gold..
    A minor point, but it may avoid a little confusion if, instead of saying "black" in reference to the iPhone 5s, say "space gray":
    "iPhone 5s — Available in silver, gold, and space gray" (Source)

  • My iphone 3g is stuck on the connect to itunes mode and it wont show up on itunes. itunes hasnt even detected it on recovery mode. what do i do i really need my phone.. please help

    my iphone 3g is stuck on the connect to itunes mode and it wont show up on itunes. itunes hasnt even detected it on recovery mode. what do i do i really need my phone.. please help

    Please stop altering the fonts, it makes reading postings extremely difficult.  If help is desired, making postings difficult to read is not the way to get help.
    Put the device in DFU mode (google it), then restore.

  • I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    So just to be clear, when you say "just bought" how long ago was that? Is it on this new iPhone that you had pictures, texts, etc that you want? Were you backing up to iCloud or onto iTunes?
    This may not help for everything but if you go to iCloud.com and log in, are you able to find your pictures there?

  • Hi can anyone help me. I have a apple macbook laptop OSX 10.5.8 . When i push print, it shows my printer but says cannot communicate with printer. (epson stylus nx125). Do I need new drivers? Please help .  regards Cindy

    Hi can anyone help me. I have a apple macbook laptop OSX 10.5.8 . When i push print, it shows my printer but says cannot communicate with printer. (epson stylus nx125). Do I need new drivers? Please help .  regards Cindy

    Welcome to Apple Support Communities. We're users here and do not speak for "Apple Inc."
    Some basic printer troubleshooting steps before worrying about a printer driver:
    1. Have you tried turning the printer off and back on?
    2A. Is the printer attached with a cable?
         If yes, have you tried unplugging and re-plugging both ends of the printer cable?
         If that does not help, can you test the printer with another cable?
    2B. If your printer is not connected to the computer with a cable, have you tried restarting your printer (assuming wireless connection)?
         Have you tried restarting your wireless router?
    3. Have you tried restarting your MacBook? (Be sure to save your work first.)
    4. Does the printer have ink? (Doesn't usually generate a 'communications error' though)
    5. Have you updated OS X or the program you're trying to print from recently?

  • TS2446 my app store is not working, i tired signing in but showing me "An unknown error has occurred" my password is not wrong, please and someone help, because i need to update my macbook air. thank you

    my app store is not working, i tired signing in but showing me "An unknown error has occurred" my password is not wrong, please and someone help, because i need to update my macbook air. thank you... how can i make it work?

    I cannot sign out. When I go to the iTunes & App Stores in settings, The Apple ID field shows my id but it is faded and I cannot select the field.

  • Please could somebody help me I have an iMac which came with Tiger 10.4.10 installed I have lost my disks and I need to re-install after a hard drive failure. Where can I find this? I will upgrade to Snow Leopard after but I cannot go straight to SL

    Please could somebody help me I have an iMac which came with Tiger 10.4.10 installed I have lost my disks and I need to re-install after a hard drive failure. Where can I find this? I will upgrade to Snow Leopard after but I cannot go straight to SL

    You can go strait to SL, all you need is a retail SL DVD available from Apple for $20. The US online store has them at:
    http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard

  • HT1338 I have os 10.5.8 software on my mac and I need to update the software on my mac so I can update my iphone 4s, every time I try to update my mac with the 6.0 it says it doesn't need any updates, but my mac still has 10.5.8.... any help??  Please...

    I have os 10.5.8 software on my mac and I need to update the software on my mac so I can update my iphone 4s, every time I try to update my mac with the 6.0 it says it doesn't need any updates, but my mac still has 10.5.8.... any help??  Please...

    You must first buy Snow Leopard from Apple: 800-MY-APPLE (in the US)
    Make sure your system meets Snow Leopard's requirements:
    Mac OS X 10.6 "Snow Leopard" System Requirements
    To install Snow Leopard for the first time, you must have a Mac with:
    An Intel processor
    An internal or external DVD drive, or DVD or CD Sharing
    At least 1 GB of RAM (additional RAM is recommended)
    A built-in display or a display connected to an Apple-supplied video card supported by your computer
    At least 5 GB of disk space available, or 7 GB of disk space if you install the developer tools

  • Itunes has encountered a problem and needs to close.. please help!

    i used to have the old itunes when i got this message saying "Itunes has encountered a problem and needs to close" and it just wouldn't open! so i tried installing the new itunes and it stil gave the same message! ive done a system update on a date when it did work..and still nothing happened!!!
    ive tried uninstalling itunes, reinstalling it, that msconfig thing..and i just don't know what else i can do?? nothing seems to work. has anyone else had this problem???...if so please can u help me solve this problem!!!
    it would be greatly appreciated!

    hi i have been having the same problem with the same error message, when itunes trys to open and i have tried msconfig, allowing it in my firewall, uninstalling and reinstalling, and restoring my computer, virus scanning, ensuring that windows is up to date, and nothing has worked.
    itunes and qttask are not open in the task manager!!!
    also quicktime will not open and is also giving me the same error message "QuickTime Player has encountered a problem and needs to close. We are sorry for the inconvenience."
    I sent the error report and got told that apple haven't come up with a solution for the problem ..... *how helpful*
    when uninstalling itunes i have just realised that it was not also uninstalling quicktime, so i tried to uninstall quicktime and got the fllowing message
    "unhandled exception
    error number:0x80040707
    description: DLL function call crashed: QTInstallcode.QuickTimeUnInstallProc
    setup will now terminate"
    ???? what do i do ????

  • I made a big mistake in purchasing ringtone Edited by Host ASAP; I'm afraid that my card will be charged a lot; please call me...I need a live person to help me on this matter

    I purchased 2 ringtones in "i tune store", but i think i made a big mistake; please help me because Im afraid that i will be charged a lot; <Edited by Host> ; i need a live person to help me.
    Catherine

    These forums are not moderated by Apple, we are all Users like you.
    Posting your personal phone number here is a terrible idea.  I'll report your post to have a moderator edit out the sensetive info.
    As to your actual concern, you can use iTunes Support, which also will refer you to THIS article (http://support.apple.com/kb/HT1933 about reporting issues with iTunes purchase

  • I have QuickTime Player 7.6.8, I cannot update or remove it b/c I am missing QuickTime.msi file. It is gone and I need it back. Please help.

    I have QuickTime Player 7.6.8, I cannot update or remove it b/c I am missing QuickTime.msi file. It is gone and I need it back. Please help.

    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center on June 25. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any QuickTime entries and click "Remove".
    Quit out of CleanUp, restart the PC and try installing iTunes again. Does the install go through properly now?
    (If you do find a clean download site for the correct version of CleanUp, please don't tell me where it is. Without wishing to sound paranoid (although I grant it does sound paranoid), there is a non-zero chance that posting links to download locations for the utility here at Discussions leads to that download location being shut down.)

  • I bought an iphone5 from saudi arabia,can i use it in india?is there any requirements i have to take?many one are saying i need to unlock it,please any one help me,i did'nt activate my phone yet.

    i bought an iphone5 from saudi arabia,can i use it in india?is there any requirements i have to take?many one are saying i need to unlock it,please any one help me,i did'nt activate my phone yet.

    If the phone is unlocked then you can use it in India.
    If your phone is locked, then the only way to get the phone unlocked is to contact your phone company/carrier. The person that sold you the phone in Saudi should have told you whether it was locked or unlocked.  Contact them to check and then contact the carrier to have it unlocked if it is locked.
    Other than that there is not a lot that you can do - perhaps it was unwise to purchase a phone in Saudi - it won't have Facetime on it if you got it there.

  • HT4097 My ipad and mini pad won't update though it says several apps are in need of update. Please help!

    My ipad and mini pad won't update though it says several apps are in need of updates. Please help!

    Try updating from here:
    App Store>Purchased
    Note: You'll have to look out for apps that need update.

  • I have a macbook 13in mid 2010, im trying to update it from 10.6.4... i update it and restart i but when it finishes restarting, it says its still 10.6.4 and i need to update? please help!

    I have a macbook 13in mid 2010, im trying to update it from 10.6.4... i update it and restart i but when it finishes restarting, it says its still 10.6.4 and i need to update? please help!

    Try downloaded the Mac OS X 10.6.8 Update Combo v1.1 standalone updater and installing it.

  • I'm trying to reinstall Logic Pro 9, and it says It's already installed. I have a project due for class and I need help asap. Please help!!!

    I'm trying to reinstall Logic Pro 9, and it says It's already installed. I have a project due for class and I need help asap. Please help!!!

    Yea I am. I deleted Logic Pro 9 and moved the App to the Trashcan like normal. Then when I go to install it, it says its already Installed. When I do this with other apps; it works fine, the install thing comes back up like it should once you have deleted the app

Maybe you are looking for

  • How do I install Windows 7 on my new MacBook Air?

    Hey everyone, I just purchased a MacBook Air (4GB ram & 256 SSD) with Lion OS... I have been a PC user for forever & a day... I am going to be installing Windows 7 on it because Wellview is not a mac friendly program aswell as other programs. I am tr

  • JCO.SERVER could not find the server function

    Hi, I am calling "BAPI_COMPANY_GETDETAIL".thuough the zprogram"ZBAPI_COMPANY_GETDETAIL" REPORT ZBAPI_COMPANY_GETDETAIL. DATA:BEGIN OF ITAB, RCOMP LIKE T880-RCOMP, END OF ITAB. ITAB-RCOMP = 99999. CALL FUNCTION 'BAPI_COMPANY_GETDETAIL' EXPORTING COMPA

  • Does Adobe Reader 10.X supports PAdES Part3 (PAdES Enhanced) ?

    Hi, I have been browsing through some of the release notes and forums for the PAdES part that Reader 10.X supports, however with no luck. I am interested to know from which Reader version PAdES Part3 is supported. Thank you, Alice

  • How my Ubuntu/Firefox 3.6.16 turned into Microsoft I.E. with a Virus Warning.

    When I was 'Surfing' the Internet, looking for some "Train" Photo Wallpapers, when I clicked on a Photo to view, my Firefox 3.6.16 browser turned into a "Fake" I.E. Browser Page with a Windows "Defender" warning box in the center stating that my syst

  • Trigger problem - help please

    I'm trying to create a trigger that will fire only when a specific column is changed. I ran a test that isn't doing what I expect. I created the following trigger. I expect it to only fire when "time_zone" changes but if I update another field, and n