Any other way to write this using nvl(x,v) locator.

please solve my confusion.
select * from emp
where nvl(to_char(temperature),'a')
in (select nvl(to_char(temperature),'a') from emp
where ename = 'SCOTT');
temperature column in numeric value. Is there anyother way to execute the same answer without using type casting(to_char).
can we use above queries ans without to_char..
Edited by: user8710598 on Aug 19, 2009 10:18 AM

Hi Solomon,
I think you are forgot one case ( if sal is null).
Sincerly it's good solution Solomon, I learned a good method to avoid scan table two times.
Tanks Solomon.
Good job.
SELECT *
  FROM (SELECT e.*,
               MAX (CASE
                       WHEN ename = 'SCOTT' OR temperature IS NULL
                          THEN 1
                    END
                   ) OVER (PARTITION BY temperature) scotts_temperature_club
          FROM emp e)
WHERE scotts_temperature_club = 1
SELECT *
  FROM emp_test;
     EMPNO ENAME      JOB              MGR HIREDATE          SAL       COMM     DEPTNO
      7369 SMITH      CLERK           7902 1980-12-17        800                    20
      7499 ALLEN      SALESMAN        7698 1981-02-20       1600        300         30
      7521 WARD       SALESMAN        7698 1981-02-22       3000        500         30
      7566 JONES      MANAGER         7839 1981-04-02                               20
      7654 MARTIN     SALESMAN        7698 1981-09-28       1250       1400         30
      7698 BLAKE      MANAGER         7839 1981-05-01                               30
      7782 CLARK      MANAGER         7839 1981-06-09       2450                    10
      7788 SCOTT      ANALYST         7566 1987-04-19       3000                    20
      7839 KING       PRESIDENT            1981-11-17       5000          0         10
      7844 TURNER     SALESMAN        7698 1981-09-08       1500                    30
      7876 ADAMS      CLERK           7788 1987-05-23                               20
      7900 JAMES      CLERK           7698 1981-12-03        950                    30
      7902 FORD       ANALYST         7566 1981-12-03       3000                    20
      7934 MILLER     CLERK           7782 1982-01-23       1300                    10
SELECT *
  FROM (SELECT e.*,
               MAX (CASE
                       WHEN ename = 'SCOTT' OR sal IS NULL
                          THEN 1
                    END
                   ) OVER (PARTITION BY sal) scotts_salary_club
          FROM emp_test e)
WHERE scotts_salary_club = 1
     EMPNO ENAME      JOB              MGR HIREDATE          SAL       COMM     DEPTNO SCOTTS_SALARY_CLUB
      7788 SCOTT      ANALYST         7566 1987-04-19       3000                    20                  1
      7521 WARD       SALESMAN        7698 1981-02-22       3000        500         30                  1
      7902 FORD       ANALYST         7566 1981-12-03       3000                    20                  1
      7566 JONES      MANAGER         7839 1981-04-02                               20                  1
      7876 ADAMS      CLERK           7788 1987-05-23                               20                  1
      7698 BLAKE      MANAGER         7839 1981-05-01                               30                  1
6 rows selected.

Similar Messages

  • My video needs to go on a SD DVD single layer-it is 1h 51m long-the only way I can make is fit is encode H. 264-not ideal-I am using the Share option in FCP-native media was shot 980x720...any other way to do this??

    My video needs to go on a SD single layer DVD…it is 1h 51m long…the only way I can make it fit is encode H. 264…not ideal…I am using the Share option in FCP…native media was shot 980x720...any other way to do this??

    To play on DVD Players, it has to be MPEG2.
    It's under 2 hours; I'm surprised it won't fit. If not, get Compressor and lower the bit rate to fit.
    The native resolution was 980X720…you mean 960?
    It will all be resized to 720X480, which is DVD standard.
    Russ

  • My ipad2 freezes when i try to delete a email that has a 78mb pdf attached. Is there any other way to delete this file other than through the email program?

    My ipad2 freezes when i try to delete a email that has a 78mb pdf file attatched. Is there any other way to delete this file other than the email program?

    If it's not MobileMe, use Safari to access the server directly and delet from there. If it is MobileMe, do the same thing but from your computer as the iPad Safari won't connect to MobileMe mail.

  • My iphone was stolen, when i tracked my phone its already offline so without hesitation i deleted it. Is there any other way to track it using serial number? or make the phone good as a dead iphone?

    my iphone was stolen, when i tracked my phone its already offline so without hesitation i deleted it. Is there any other way to track it using serial number? or make the phone good as a dead iphone?

    Sorry, there is no way to track your phone. Call your carrier, & if they offer blacklisting, have them blacklist your phone.
    Since you're running iOS 7.0. the phone is useless to anyone but you, as it cannot be re-activated without knowing your Apple ID/Password.

  • I can't activate my iphone because my cousin's account was hacked. Is there any other way to fix this?

    my aunt got my cousin a new iphone, so she gave me my cousin's old iphone. I reset the the phone she gave me so i can set it up for my own use now. The problem is that i need the account of my cousin in order to activate the phone, the bad news is that her account was hacked. Is there any other way that i can activate this account and put it on my list of devices? So that if i want to reset it, i'll just use my account to activate it.
    P.S.
    i Do have a proof that this phone was given to me by my aunt and she is the one who bought it for my cousin.

    Your cousin needs to contact Apple and ask to speak to someone in account security to get the Apple ID back under his/her control.
    If your aunt has original proof of purchase for the phone, she can bring that, along with the phone, to an Apple store or call Apple and they may be able to assist.
    ~Lyssa

  • Any other way to achieve this?

    SQL> desc cname
    Name Null? Type
    ID NUMBER
    CTYPE VARCHAR2(10)
    CLIAS VARCHAR2(10)
    SQL> select *from cname;
    ID CTYPE CLIAS
    11 acn tst
    12 acn tst
    12 ucp nbs
    12 asf trp
    SQL> ed
    Wrote file afiedt.buf
    1 select a.id,a.ctype,a.clias from cname a, cname b
    2 where
    3 a.ctype = b.ctype and
    4 a.clias = b.clias and
    5* a.rowid!=b.rowid
    SQL> /
    ID CTYPE CLIAS
    12 acn tst
    11 acn tst
    SQL>
    Any other way to achieve the above output?
    Thanks. :-)

    Maybe
    select id,ctype,clias
      from cname
    where (ctype,clias) in (select ctype,clias
                               from cname
                              group by ctype,clias
                              having count(*) > 1
                            )Regards
    Etbin
    NOT TESTED as I don't have database access on weekends/holidays

  • Installed successfully but network is not connected. Yet when I go on my Mac network is connected. Is there any other way to solve this problem? Please help.

    Hi,
    I have just installed Windows 7 Home Premium on my Mac book Pro 13inch, it installed successfully but there is no network connection. Yet when I go on my Mac I can get online no problem. Please help or what other way I can do to connect windows online?

    Did you download Windows Support Software when you started installing windows via Bootcamp. If yes you need to then install the Support Software after installing windows which contains Windows drivers for Mac hardware.

  • My ipad was having problems opening viewers, but I learned to power it  off and wait about a minute and turn it back on and it rests the issue, do you have any other ways or ifs this the best it worked pretty good this time, but  if it happens again

    My Ipad has trouble opening setting tab and safari, it opens abd before you can enter anything the iPad shuts it down to the home screen, I mainly use my ipad for the internet or emails, I know the internet works because I still receive emails on it.  Please help me out here.

    Try clearing Safari, close all apps and reset the iPad.
    Go to Settings>Safari>Clear Cookies and Data.
    Tap the home button once. Then tap the home button twice and the recents tray will appear at the bottom of the screen. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button twice.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • I want to reload a Firefox webpage when it is idle for 2 minutes. Is there any add-on ? or any other way to do this.

    I want the page to be reloaded when it is idle for some period of time only. I need a step by step procedure for this.

    https://addons.mozilla.org/en-US/firefox/addon/reloadevery/

  • I have a Mac OSX version 10.75 with just one Thunderbolt port. and it has been my Thunderbolt port to connect with Blackmagic wear my intensity. and I no longer can use the port for mini-DVI adapter to connect with me. I do not want to ask any other way f

    i have a Mac OSX version 10.75 with just one Thunderbolt port. and it has been my Thunderbolt port to connect with Blackmagic wear my intensity. and I no longer can use the port for mini-DVI adapter to connect with me. I do not want to ask any other way for me to use to use my monitor. I monitor LG FLATRON E2041 brand .. PLEASE Helpp ME

    i have a Mac OSX version 10.75 with just one Thunderbolt port. and it has been my Thunderbolt port to connect with Blackmagic wear my intensity. and I no longer can use the port for mini-DVI adapter to connect with me. I do not want to ask any other way for me to use to use my monitor. I monitor LG FLATRON E2041 brand .. PLEASE Helpp ME

  • My iphone 4s' screen is black, but it's still on and charging. I broke my lock screen button so I am unable to turn it off using the home button and lock button. Is there any other way my phone can restart or turn off ? Is my phone broken for sure?

    My iphone 4s' screen is black, but it's still on and charging. I broke my lock screen button so I am unable to turn it off using the home button and lock button. Is there any other way my phone can restart or turn off ? Is my phone broken for sure?

    Kbkohn wrote:
    I am in tears right now because I entered all my 11month old sons milestones into my phone and now I have nothing I'm so upset and am hoping there is a way to get this information back. 
    Most intelligent people would not store such sensitive data on a device that could so easily be lost, stolen, or damaged.  Even if they chose to do so, they would use the device as designed and regularly sync and backup that device as described in the User's Guide.
    Have you done so?  If you have, all of the data is either in iCloud or iTunes on your computer.  Replace the device and restore the new iDevice with the backup of the old one.

  • Why is it like if i don't sync the data in my pad to the itunes of my system ,the data in my ipad is getting cleared when i copy any thing to my ipad.This is not comfortable rite?why is this so.?or there is any other way?

    Why is it like if i don't sync the data in my pad to the itunes of my system ,the data in my ipad is getting cleared when i copy any thing to my ipad.This is not comfortable rite?why is this so.?or there is any other way?

    i noticed this as a bug in iTunes. make sure the correct file is selected in the preferences menus. It does not have to be the default location directiory as Vazandrew stated. your iTunes music library can be anywhere you want it. i have mine on an external cuz i'm a dj and have over 80,000 songs.
    once you select/verify the location of your music library, simply drag the folder into the left panel in iTunes from a finder window. iTunes does not automatically add the items like it use to for some reason.

  • Western Digital My Book World EditionI have bought a WD My Book World Edition to use for back-up of my iMac, but when I try and log onto the drive with Apple time Machine (back-up software) or connect in any other way i get the message 'There was a proble

    I have bought a WD My Book World Edition to use for back-up of my iMac, but when I try and log onto the drive with Apple time Machine (back-up software) or connect in any other way I get the message 'There was a problem connecting to the server "MybookWorld.local" The version of the server you are trying to connect to is not supported. Please contact your system administrator to resolve the problem'
    It is a brand new iMac and running Lion OSX
    Any ideas on how to solve would be gratefully received?

    Followed the directions on this page and it worked!
    http://forums.macrumors.com/showthread.php?t=1102423
    Part One - Turn on SSH (in the admin panel)
    [1] Go to to http://mybookworld.local
    [2] login: username will be admin, password will be whatever you have setup. If you can't remember it should be in your Mac OS X keychain (Utilities > Keychain Access, search for "mybookworld"). If you have not changed if from the default the password will be admin as well.
    [3] Switch to advanced mode.
    [4] From the System tab, pick Advanced.
    [5] Enable SSH Access, and click submit.
    [6] Click on the network tab and then the LAN button
    [7] Make a note of the IP address
    Small, maybe obvious, but nevertheless important point: For the install to work, your NAS needs to be connected to a router with internet access.
    Part Two - Install netatalk2.2
    [8] Open Terminal.app (Utilities > Terminal)
    [9] Enter the following command (substitute in 127.0.0.1 for the actual IP address you noted down in step 7), then hit return:
    Code: 
    ssh [email protected]
    [10] When prompted, enter the ssh password (will be welc0me).
    [11] You are now going to download the installer. Enter the following command, then hit return:
    Code: 
    wget http://mybookworld.wikidot.com/local--files/netatalk2-2-on-whitelight/install_netatalk.sh -O install_netatalk.sh
    [12] Once completed, you will need to run the installer. Type:
    Code: 
    sh install_netatalk.sh
    [13] You will be asked a number of question during install, answer yes to all. When asked about the "DHX2 login process", I opted to install the modified version, so I can confirm it works.
    [14] Once the box has restarted, you should be able to connect to your afp shares and continue to use Time Machine.

  • Hi, I have lost my iphone but i have its backup in itunes, how can i restore my contact/sms using itunes or is there any other way, please help

    Hi, I have lost my iphone but i have its backup in itunes, how can i restore using itunes or is there any other way for this
    please suggest

    You can restore that backup to a replacement iPhone, if that's what you're asking. If you want to extract data from the iPhone backup, you'll need third-party software to do so:
    http://www.iphonebackupextractor.com/

  • I have a new macbook pro and want to transfer my Mail autofill from my old mac. Never used Time Machine or Migration Assistant -- looks complicated. Any easy way to do this?

    I have a new macbook pro and want to transfer my Mail autofill from my old mac. Never used Time Machine or Migration Assistant -- looks complicated. Any easy way to do this?

    caitlinfromcambridge wrote:
    Thanks -- I would like to try this. I do not know how to reach hard drive from old mac to new. Can you help me with this?
    There are two ways - you can boot your old Mac in Target Mode (reboot your Mac, and as soon as you hear the startup chime hold down the T key on the keyboard until you see the yellow/orange Firewire logo on screen).  You can then use a FireWire cable to connect your new mac to your old one.  The old Mac hard drive will appear on your new Mac as if it is an external hard drive.
    Details on Target Disk Mode:  http://support.apple.com/kb/ht1661
    If you don't have a firewire cable but you do have a home network (i.e. both computers can access the Internet at the same time), you can share the hard drive on your old Mac and then connect to it on your new Mac.
    Good article on sharing your hard drive:  http://support.apple.com/kb/HT1549
    Finally, if the above doesn't thrill you, you can hook an external drive to your old Mac, copy the mail folder over to it, then connect the external drive to your new Mac and copy it over.  It's two steps, but if you don't have a firewire cable and aren't comfortable with sharing over a network it will work just as well - you just have to wait for the mail folder to copy twice instead of once.
    If you get stuck post back!

Maybe you are looking for