Greatest to return the dt but I also want to return corresponding field

I am using the following statement to return the the most current date.
How do I use this to tell me if date_one date is return then I want the field this_one also.
Or if date_two date is return then I want the field this_two return also
select greatest(date_one,date_two) from (
select sysdate date_one,to_date('08/01/2009','mm/dd/yyyy') date_two,9 this_one,4 this_two from dual)
Howard

Hi, Howard,
csphard wrote:
sample data
WITHDRAWAL_DECISION_DATE HEARING_DECISION_DATE WITHDRAWAL_DECISION_TYPE_ID HEARING_DECISION_TYPE_ID
09-JUL-09           14-JUL-09                2                6
09-JUL-09           14-JUL-09                2                2
13-AUG-09      07-AUG-09           2                4
24-AUG-09      26-AUG-09           2                6
19-AUG-09      02-JUL-09                2                6
09-JUL-09           14-JUL-09                1                2
09-JUL-09           14-JUL-09                1                2
What I would like to see is
WITHDRAWAL_DECISION_DATE HEARING_DECISION_DATE WITHDRAWAL_DECISION_TYPE_ID HEARING_DECISION_TYPE_ID
               14-JUL-09                               6
               14-JUL-09                               2
13-AUG-09                          2                     
               26-AUG-09                          6
19-AUG-09                          2                     
               14-JUL-09                               2
               14-JUL-09                               2
but what I get is
GREATEST(TAIT.WITHDRAWAL_DECISION_DATE,TAIT.HEARING_DECISION_DATE) CASEGREATEST(TAIT.WITHDRAWAL_DECISION_DATE,TAIT.HEARING_DECISION_DATE)WHENTAIT.WITHDRAWAL_DECISION_DATETHENTAIT.WITHDRAWAL_DECISION_TYPE_IDELSETAIT.HEARING_DECISION_TYPE_IDEND
14-JUL-09 6
14-JUL-09 2
13-AUG-09 2
26-AUG-09 6
19-AUG-09 2
14-JUL-09 2
14-JUL-09 2 Are you saying that you want different column headings only?
Seriously, if you hadn't posted this message yourself, would you understand the difference?
When posting formatted text on this site, type these 6 characters:
{code}
(small letters only, inside curly brackets) before and after formatted text, to preserve spacing.
Is this the output you want?
WITHDRAWAL_DECISION_DATE HEARING_DECISION_DATE WITHDRAWAL_DECISION_TYPE_ID HEARING_DECISION_TYPE_ID
                14-JUL-09                             6
                14-JUL-09                            2
13-AUG-09                           2
                26-AUG-09                             6
19-AUG-09                           2
                14-JUL-09                            2
                14-JUL-09                            2 If so, here's how you can get it:
SELECT  CASE
          WHEN  withdrawal_decision_date >= hearing_decision_date
          THEN  withdrawal_decision_date
     END          AS withdrawal_decision_date
,     CASE
          WHEN  withdrawal_decision_date <= hearing_decision_date
          THEN  hearing_decision_date
     END          AS hearing_decision_date
,     CASE
          WHEN  withdrawal_decision_date >= hearing_decision_date
          THEN  withdrawal_decision_type_id
     END          AS withdrawal_decision_type_id
,     CASE
          WHEN  withdrawal_decision_date <= hearing_decision_date
          THEN  hearing_decision_type_id
     END          AS hearing_decision_type_idfrom dpss_ash.tbl_aid_issue_types tait
FROM      dpss_ash.tbl_aid_issue_types tait
where     tait.WITHDRAWAL_DECISION_TYPE_ID      is not null
AND     tait.HEARING_DECISION_TYPE_ID           is not null
;Untested.
This assumes that the dates are never NULL. If the two dates on any row are exactly the same, all four columns will appear on that row.

Similar Messages

  • I would like to mirror a movie on the tv but I also want to be able to do other things with out that being mirrored also how do I do this?

    I have nephews I am trying to enterain, while they love movies I have homework to do on my lap top. Is there any way of playing a movie  with out the rest of my work showing up on the screen?
    Thanks for any help
    Nikole

    If you can hook up your TV like an external monitor with something like a mini-display > HDMI cable, you can turn off mirroring here:
     > System Preferences > Display
    Uncheck the 'mirror display' box at the bottom of the window (I think it's in the 'Arrangement' tab).

  • Having trouble figuring out how to save the original photo after I've cropped it - i.e. I want to create a headshot of my husband from a photo of the two of us, but I also want to keep the original. Seems very basic, but can't seem to figure it out. Any h

    Having trouble figuring out how to save the original photo after I've cropped it - i.e. I want to create a headshot of my husband from a photo of the two of us, but I also want to keep the original. Seems very basic, but can't seem to figure it out. Any help would be great!

    Use File >> Save As
    Choose a different file name so as not to overwrite the original and don't save any changes when closing the original.

  • I down loaded sygic on my iPhone 3s but the icon is missing even in the search but when I want to download it again ,it say this application is present, how can I make the icon to show up

    I down loaded sygic on my iPhone 3s but the icon is missing even in the search but when I want to download it again ,it say this application is present, how can I make the icon to show up

    - Have you tried a reset. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Try syncing  the iPod to your computer. Then delete from iTunes and sync. that should delete it from the iPod. Then redownload it.

  • My sister has a mac and i want to update my phone onto the computer but i dont want her to see all my stuff can you somehow have more than one itunes account on the same computer so my stuff with save?

    my sister has a mac and i want to update my phone onto the computer but i dont want her to see all my stuff can you somehow have more than one itunes account on the same macbook so my stuff with save?

    How to use multiple iPhone, iPad, or iPod devices with one computer. The only way is for you to have a separate user account to log into on that computer.

  • I am trying to change my email address for an Apple ID and it is saying that it is already in use. I then sign in with that Apple ID and it says that the account is not set up yet, I don't want to set up the account, but I do want to use the email address

    I am trying to change my email address for an Apple ID and it is saying that it is already in use. I then sign in with that Apple ID and it says that the account is not set up yet, I don't want to set up the account, but I do want to use the email address in my original Apple ID! HELP!

    Welcome to the Apple community.
    Once you have created a rescue address, you cannot delete it, nor can you change it to the same address as used by your ID. There are numerous providers you can get additional email addresses from, such as Hotmail, Yahoo, Google etc etc.

  • TS1135 Low quality warning on a photo in a photobook. I understand the warning but I still want to go ahead with my design, will it get printed or will the page be deleted?

    Low quality warning on a photo in a photobook. I understand the warning but I still want to go ahead with my design, will it get printed or will the page be deleted?

    Sorry 1 further question please..
    the  pixel width is 1,076 and heigth is 793 and I want to have this photo as a background in a 13 x 10 inch book
    Will this be ok?
    Thanks

  • My iPad2 seems to be sending gobs of emails to the addressee, but I only wanted to send 1copy.  It's almost as if a virus is doing this!  Any suggestions?

    My iPad2 seems to be sending gobs of emails to the addressee, but I only wanted to send 1 copy.  It's almost as if a virus is doing this!  Any suggestions?

    My iPad2 seems to be sending gobs of emails to the addressee, but I only wanted to send 1 copy.  It's almost as if a virus is doing this!  Any suggestions?

  • Can I synch 2 iPhones to 1 iPad? I want my contacts,calendar, pics etc. in the ipad but my husband wants his stuff there too. Thanks!

    Can I synch 2 iPhones to 1 iPad? I want my contacts,calendar, pics etc. in the ipad but my husband wants his stuff there too.
    Thanks!

    Only if you merge them together into one Address Book/Contacts and iPhoto Album(s), the iPad doesn't have individual logins/usernames (with their own unique data) as Mac computers allow.

  • I NEVER entered a password for the backup but now I want to restore my iphone and itunes asks for one. What can I do?

    I NEVER entered a password for the backup but now I want to restore my iphone and itunes asks for one. What can I do?

    @Razmee209 is right there is nothing you can do if it is an encrypted back up
    iOS: Troubleshooting encrypted backups - Apple Support
    BUT you could try to see if you have a back up that is not encrypted. If you go to iTunes Preferences (On a Windows go to Edit Menu under the Play Button - On a Mac click on iTunes at the top left) Click on Devices and if you see a back up that does not have a lock next to it you will be able to restore from that back up without using that password.
    Encrypted passwords are set up at the time you create the back up.

  • Hey Guys, I have Ipod Touch 2nd generation and it needs to be upgraded to iOS 4.3 but the music isnt on my computer. I don't want to loose the music but I really want to upgrade it.

    Hey Guys, I have Ipod Touch 2nd generation and it needs to be upgraded to iOS 4.3 but the music isnt on my computer. I don't want to loose the music but I really want to upgrade it. Help!

    That iPod can't be upgraded past 4.2.1.
    (71930)

  • I can't connect to the itunes store and have some problems with other websites. Some websites load OK. I had the same problem on my iPad and changed the DNS, but don't want to do this on my iMac, anyway, surely I should have my router's DNS?

    I can't connect to the iTunes store from my iMac and have problems loading a number of other websites, however some websites load perfectly well. I have had the iTunes store issue on my iPad and resolved it by changing the DNS but surely I should use the DNS for my router. I don't really want to change it for the iMac as I access secure sites with it to internet shop.
    Any ideas, I was going to try loading Chrome but can't get it without going through the iTunes store. Anyway, that is treating the symprom not the cause.

    Adding Open DNS codes to your Network Preferences, should give good results in terms of speed-up as well as added security, (including anti-phishing and redirects) (Full information about Open DNS is here: http://www.opendns.com/home/nobloat ) and further independent information can be read here:
    http://reviews.cnet.com/8301-13727_7-57338784-263/free-dnscrypt-tool-enhances-ma c-web-security/?tag=mncol;txt
    and here:
    http://www.macworld.com/article/1146064/troubleshootdns.html?t=234
    Open System Preferences/Network. Double click on your connection type, or select it in the drop-down menu, and in the box marked 'DNS Servers' add the following two numbers:
    208.67.222.222
    208.67.220.220
    (You can also enter them if you click on Advanced and then DNS)
    Sometimes reversing the order of the DNS numbers can be beneficial in cases where there is a long delay before web pages start to load, and then suddenly load at normal speed:
    http://support.apple.com/kb/TS2296

  • HT203167 I had 25 tv shows in my itunes library, and 3 movies. Now there all gone, I can access them thru the store but I dont want to download all over again. There was like 50 gb of video. What do I do, Its impossable to contanct apple about it.

    I had almost 30 different seasons of tv shows in my library, alot. Now there all gone, my library is blank. My purchases are in my purchasd section on the store but I dont have enough space to download them all over again. I cant figure out what happend to them. I just watched one, then turnd my pc off, and later that day they were gone. And its IMPOSSABLE to contact apple about it, I dont know why its so hard to ask them any kind of question... Please help..

    Welcome to the Apple Community.
    The Apple TV 2 will play all the content in your iTunes library that your Apple TV 1 does. It can no longer sync any of it but can stream it all just as the older model did. Airplay is a different feature that lets you stream from an iPad/iPhone, the Apple TV 2 has Airplay the first didn't.
    You can still sort and search content by genre, it still marks content watched and unwatched and mainly still lets you organise much as the Apple TV 1 did, with one exception. It doesn't do nested folders, so the ability to tag a movie as a show (ie James Bond) and have all the associated movies in a James bond folder has gone and it lists all these movies individually.
    It has a similar situation with TV shows. It will put all TV shows in a series in a folder as the older one did, but the new one lists each series separately whereas the older model would put all the series in one folder.
    Not nesting folders is a bit of a pain with large libraries and whilst I don't like it, it's more or less the only compromise I have to make and of course I get additional features too.

  • HT4168 epub: I'd like to create chapters for the TOC but don't want the new chapter to begin on a new page. I'd like it to begin on the same page as the prior chapter. How can I do that?

    How can I do this? I currently have my TOC chapters listed as Apples, Oranges, and so on.  But my text chapters begin something like this:
    1
    Apples
    2
    Oranges
    I have "Apples" with header 1, "Oranges" with header 1, etc., so that very nicely in the TOC it is listing my topics as the chapters. However, within the body of the document, 1 appears on one page and "Apples" begins at the top of a new page, separated from "1"; 2 appears one one page and "Oranges" appears at the top of the next page (separated from the "2), and so on.
    Because of the way the book is structured, I need to have the chapter numbers on a top line and the chapter topic beneath it. (The book is further subdivided, such as 1.3a, 1.3b, etc.)
    What I would like is for the TOC to indicate my chapters as Apples, Oranges, etc., but for the chapter text to begin as indicated above.
    How can I do this?  Thanks.

    Peter, I styled the wording of the chapter title (e.g. apples) with my heading1 styling and my sub-chapter titles were heading2. The text is a different font, different color, different size, different everything.  It seems that the epub program has an automatic format to start a new page with each new header. That's what I'm trying to work around. (Originally I styled both the numeral and the chapter title as "heading 1" and it gave each a different page!)
    I am in the process of removing all headers and styling everything manually (which is how it was originally) just to avoid this problem.
    I'm having my e-book done through a publisher (this will be self-published), so I'll be giving them a .docx and they'll convert it to .html (filtered) then .epub. so I need something that creates my Table of Contents as I'd like it, without messing up the text of the book.
    I can give them a list of what I want in the Table of Contents, and have them manually do it, but the TOC may or may not come out how I want it to come out. My preference is to have something automatic. I wanted the sub-units (heading 2) in the TOC but that will never work since I have over 200 of them and it's too much for them to do manually.  It's a very slow process.

  • Ended Alveza card status I have been asked by Apple to update the card, but whenever you want to update the collateral does not accept Visa site update Why

    Visa expired my right was my claim by Apple update the credit card, but whenever you want to update the Visa my right in the site does not accept site update Why

    if i have to read any comment by matt n again i will throw up...in my mouth. i have gone all over google trying to figure out what the f ff did to me without my permission, i have updates turned off so there should be no prompting to restart, there should be a polite offer not a forced update. i am angry and so are a ton of people.
    everytime i go to a new complaint, another angry fellow ff user there is matt n with his infuriating smiling little picture...telling me about the awesome safety and security of the new ff...ignoring that a supposed safe but ugly and unusable browser is worse than a customized, beautiful, well functioning browser...with supposed safety issues. i am so angry i cannot express how this has wasted my time. i have been online for 2 hours now figuring out how to fix, apparently i cannot. my old theme is not compatible now...so i am screwed.
    good bye. if i wanted chrome i would have had chrome. but i have no choice now.

Maybe you are looking for