I have problem with value NULL when the use CASE statement please help this question

I have problem with value NULL when the use CASE statement please help this question


Table: digital_val

SNO cl C2

1 San1 11

2 22 San2

Actual result: expected to A         B

A            B                                                                           11        22

11 NULL

22 NULL



query:

Select case when c1 = "san1" then c2,.

case If c1 = "san2" then c2 B

of digital_val

I'm more curious why, when you select 2 rows, you expect a result of row?

WITH digital_val

AS (SELECT 1 AS 'Sno', 'San1"C1, c2 FROM DUAL 11)

UNION ALL

2 SELECT AS 'Sno', 'San2"C1, c2 FROM DUAL 22)

SELECT CASE WHEN c1 is "San1" THEN END AS A c2.

CASE WHEN c1 = "San2" THEN END AS B c2

OF digital_val;

With no other input, if you select 2 rows, you get 2 rows.  One of the other solutions use a max function, but is this really what you want, does not specify?

Tags: Database

Similar Questions

  • I have problem with Muse files when you work at home with my laptop and when I open the files again in my work with my IMac.

    I have problem with Muse files when you work at home with my laptop and when I open the files again in my work with my IMac.

    I do: when I am uncomfortable with the laptop I save the files on the laptop, then on my external hard drive. Then, when I'm at work, I opened the drive, but the Muse says every time, that so many links in the 'active' is missing. And it takes a lot of time to get all the missing link. Like today I had to open a file of Muse from the external hard drive, and there are about 100 links that are missing.

    How can I solve this problem

    the best thing if you are a user of creative cloud is to store the files in a folder in your account of cloud instead of transferring the files from one computer to another.

    If you are not a Subscriber cc then Dropbox or iCloud will work as well.

  • I have problems with my application of the java language.

    I have problems with my application of the java language. It will be open only for about one second, and it won't let me write all programs, it looks like the command prompt when opening. what the * is underway and what can I do to solve this problem.

    Hey Kevin,

    The description of the problem seems a little unclear and I wish I had a better understanding before you start working on it.

    I would really appreciate if you could answer the following questions:

    1. is the specific question of the application of the Java language?

    2. did you of recent changes made to your computer before the show?

    3. you receive an error code or message?

    Please provide us with more information on the specific question to help you to fix as soon as possible.

    If the problem is specific to the Java application, then I suggest you to contact Java support from the links below:

    http://www.Java.com/en/download/support.jsp

    Java Help Center:

    http://www.Java.com/en/download/help/

    Your response is very important for us to ensure a proper resolution. Please get back to us with the information above to help you accordingly.

  • Problem with my VM and I can not run, Please HELP

    Hi all

    It's URGENT because I have problems with my virtual maching and I can't start it and all my work is out there and I don't have any other copy.

    the problem appears as follows:

    The machine virtual version 6.0.0 is installed on my laptop on drive e. I used for a long time and space on drive E is low. I wanted to copy visual studio 2010 from my laptop to the virtual machine when I got an error which has restarted the VM, but it didn't restart and always give me this error "could not open virtual machine: Machine WS2003\Windows Server 2003 Standard Edition.vmx E:\Virtual.» ' is not a configuration file valid virtual machine. I continued to try to find a solution. «I found the empty vmx file, so I tried to solve the problem of vmx but still I don't get this error»

    File not found: Windows Server 2003 Standard Edition - 000002.vmdk
    This file is required to power on this virtual machine.  If this file has been moved, please provide its new location. «or that the error "could not open the file" E:\Virtual WS2003\Windows Server 2003 Standard Edition.vmdk Machine": one of the disks in this virtual machine is already in use by a virtual machine or a snapshot." when I continue to pass the file vmdk.» Please help me, I need the data on the virtual computer.
    Please find the last vmwarelog (vmware.log) and the newspaper 3 days ago, when he was working fine (vmware - 2.log) and the vmx and vmdk file.
    Thanks in advance

    It seems that the file descriptor for the second snapshot vmdk was destroyed (0 bytes). Please find the file recreated in the attachment. I also corrected the .vmx file to point to the 000002.vmdk descriptor. To replace the files, make sure that VMware Workstation is closed or at least tab of the virtual machine is closed.

    Since there were errors in the vmware.log, this cannot solve all problems, but it must produce at least one new vmware.log which can then be used to troubleshoot further.

    André

  • problem with checkbox custom when you use the loadVariablesNum

    I have several cutomized box that he can select or deselect and I have a button to determine which of the boxes is selected and through this button, I spent the variable to loadVariablesNum corresponding to which of the boxes is selected.

    ==================================================

    the code in the button to determine which of the boxes is selected:

    ==================================================

    If (chk1.mark1._visible = true) {}
    trace ("31");
    loadVariablesNum ("http://url?uid=" + _root.uid + "& years = 31", 2);
    }
    If (chk2.mark2._visible = true) {}
    trace ("32");
    loadVariablesNum ("http://url?uid=" + _root.uid + "& years = 32", 2);
    }
    If (chk3.mark3._visible = true) {}
    trace ("33");
    loadVariablesNum ("http://url?uid=" + _root.uid + "& years = 33", 2);
    }
    If (chk4.mark4._visible = true) {}
    trace ("34");
    loadVariablesNum ("http://url?uid=" + _root.uid + "& years = 34", 2);
    }
    If (chk5.mark5._visible = true) {}
    trace ("35");
    loadVariablesNum ("http://url?uid=" + _root.uid + "& years = 35", 2);
    }

    I'm assuming that you have a problem with it not working.  A problem with it is that when you make the comparison conditionals, you use == to see if things are equal, not =

    In addition, not a mistake, but to less treatment works... you must use "elsewhere" so that once the program finds a match it does not all the remaining conditions, which would make you currently.

    If (true chk1.mark1._visible == ) {}
    trace ("31");
    loadVariablesNum ("http://url?uid="+ _root.uid +"& years = 31", 2);
    } Else if (chk2.mark2._visible == true) {}
    trace ("32");
    loadVariablesNum ("http://url?uid="+ _root.uid +"& years = 32", 2);
    } ElseIf...

    In addition, the solution of the error can be simplified in your case because you are using Boolean values (true/false).  When a conditional tests something that he's just looking to see if the value it evaluates as true or false, so your conditional statements have not even the 'is true ".

    If {(chk1.mark1._visible)
    trace ("31");
    loadVariablesNum ("http://url?uid="+ _root.uid +"& years = 31", 2);
    } Else if (chk2.mark2._visible) {}
    trace ("32");
    loadVariablesNum ("http://url?uid="+ _root.uid +"& years = 32", 2);
    } ElseIf...

    One last thing... it seems that you have created unnecessarily box different symbols where you might have used the same as that for all of them.  I say this because to see how you have different brand # for each of them.   Just assign the same name to a different instance...

    If {(chk1.mark._visible)
    trace ("31");
    loadVariablesNum ("http://url?uid="+ _root.uid +"& years = 31", 2);
    } Else if (chk2.mark._visible) {}
    trace ("32");

    This example is used to emphasize the difference between symbols and instances.  The same symbol (such as a radio button or your craft boxes) can be reused multiple times by using the names of different instances for each instance.  You can then assign unique values to the properties of each instance

  • problem with adf table when the component is added in the column of the table.

    Hi all

    I use jdev 11.1.1.5.0 version.

    use case: I created an adf table that is based on the original Version. DC now I added a component of group select a radio (which contain 4 approved, rejected, radio button back, no) in the table of the adf.
    I have table with many rows for example in the first row select approved and the next row I select reject now when I get the value of a radio button group in backing bean by using the component binding I had the last selected value. (in this case to reject).

    And the second is that when I set the value for the current by using binding as line radio button

    rb.setValue("R") then reject option selected for all lines.

    so my question is--

    How can I get and set the value of the group to select a radio at the level of the line using the element binding.

    Hello

    I don't see a reason to not use a transitional attribute for the radioGroup in your previous answer.

    Here's the example I tried.

                            
                                
                                
                                
                                
                                
                            
    

    Where DeptnoRadio is the transitional attribute, I created (which will be a few random values between A and E) and EnableDisable is another temporary variable of type Boolean that returns true or false depending on certain conditions.

    Now, for each row, the value is different (and the corresponding radio button is selected) and thereafter, which match the condition, the option is disabled.

    Arun-

  • I have problems with my keyboard change the meaning of the keys.

    I went to "fix" but said he could not fix it. ".  2 errors: problem with ISATAP adapter #9 driver and hardware problems currently my TAB key displays all the runing programs and my shift cap links P in Media Player.  Concerned may by a virus.  Note reciently installed keyboard perferial... works well for the last several days...

    Help, please

    Tina

    Hi Tina,

    Thanks for posting in the Microsoft community.

    I understand that the keyboard does not work on your computer. The Fixit you ran reported errors with ISATAP problem and hardware.

    Try the methods and check out them.

    Method 1:

    Check out the link and follow the steps.

    Open the hardware and devices Troubleshooter

    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter

    Method 2:

    Check out the link and follow the methods in the article.

    On a Windows Vista-based computer or on a Windows Server 2008-based computer, the Microsoft ISATAP map appears with a yellow exclamation mark next to it in Device Manager, and you also receive an error message

    http://support.Microsoft.com/kb/932520/en-us

    If the problem persists then let us know so that we can provide more steps.

     

  • Problem with no audio on the use of the Webcam.

    My webcam has no audio, any ideas what the problem may be?

    Hello

    Please answer these questions to get more clarity on this issue.

    -Don't you make changes to the computer before this problem?

    -Is the specific issue of webcam?

    This problem may occur because of software or hardware issues. This problem may also occur due to corrupted drivers or broken and missing updates.

    This tutorial can help you identify and resolve its current problems in Windows, including no sound from your speakers or headphones.

    No sound in Windows: http://windows.microsoft.com/en-us/windows/no-sound-help#no-sound=windows-7&v1h=win8tab1&v2h=win7tab1&v3h=winvistatab1&v4h=winxptab1

    You can also try using a different application with webcam and check if there is sound on this request.

    Response with the State of the question and we will be happy to offer you our help.

  • I have problems on windows 7 64 bit of fallout 3 Please help me

    Fallout 3 for windows 7, I bought some time ago and before that I could play, but now it crashes when I try to start a new game someone please help me

    What are your system specs? FO3 will run on Win7 with compatibility for spe SP or sp1 for Vista.
    There are also one couple of other fixes not related to Win7.

    (1) the game has a problem with the quad-core processors
    Open the fallout.ini file in My Documents\My Games\Fallout3 (make a copy first to backup)
    Find the line:
    bUseThreadedAI = 0 (open the ini with Notepad file - click on Edit - can find - copy this line and paste it into the find what box)
    her take: bUseThreadedAI = 1
    -Add another line (press ENTER on keyboard) after him and insert: (copy and paste the following line)
    iNumHWThreads = 2
    -This limit the set for 2 hearts and prevent the engine bug to cause the game to freeze.
    (2) download and install Windows 7 Codec Pack - this will fix a problem with ffdshow codec.
    http://www.windows7codecs.com/
    (3) install the latest drivers for you graphics card and audio of the mfg web site.
    (4) updated Direct X with the installer of X Web live - should be done even if there is no problem with Direct X with FO3.
    Download details: DirectX end-user performance

    (5) install all the Windows Update 'important', but don't forget to setup as Windows updates in order to not
    install "optional" without you updates by selecting, in particular drivers graphics.

    If you still have problems please visit FO3 Nexus - the best site for all games - Bethesda
    Nexus Forums

    EDIT: I recently bought a 120 Hz monitor and just discovered the game freezes up if the
    monitor is set to 100 or 120 Hz. 60 Hz has no problem.
    .

  • How to filter the Recordsets using the session variable?  Please help this makes me crazy...!

    I'm having the same problem as user "Gabe the facilitator" in a message sent in 2007.

    «My recordset that animates a PivotTable will not filter the results based on a session variable.» I know that the session variables are working because I have the echo of session variable in the page (dragged-n-dropped my session variable since the panels on my page links), and that works fine. So why can't filter my recordset with the same session variable? »

    Here is the code:

    <? php require_once('Connections/mockconn.php');? >

    <? PHP

    session_start();

    ? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    {if (! session_id ())}

    session_start();

    }

    $colname_info = "-1";

    If (isset($_SESSION['email'])) {}

    $colname_info = $_SESSION ['email'];

    }

    @mysql_select_db ($database_mockconn, $mockconn);

    $query_info = sprintf ("SELECT name, last_name, email, password registration E-mail WHERE = %s", GetSQLValueString ($colname_info, "text") ");

    $info = mysql_query ($query_info, $mockconn) or die (mysql_error ());

    $row_info = mysql_fetch_assoc ($info);

    $totalRows_info = mysql_num_rows ($info);

    ? >

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    Home < title > < /title >

    < / head >

    < body >

    < div id = "info" > Hello <? PHP echo $row_info [""];? > < / div >

    <? PHP

    If (isset($_SESSION['email'])) {}

    echo ' your email: '.' '. $_SESSION ['email'].' '.' good work ";}

    ? >

    < / body >

    < / html >

    PLEASE PLEASE HELP... I've been to this day of...

    How do I filter the recordset based on the value of the session variable

    Then it works fine.

    Each test returned correct results.  We checked one) your session variable is set correctly, b) the SQL statement is properly filtered by email, and c) the returned results are as expected.

  • TypeError: Error #1009? New to the use of AS3, please help!

    Hi, I'm doing a site in flash, and so far everything went perfectly well so far.
    I've done a few buttons using MovieClips and then animate it with some actionscript 3. from what I can tell there is nothing wrong with the code itself, the problem is with the clips or symbols or something...? what I need help!


    Here is the code for one of the buttons (I use the same code for each button only change the name of the instance):

    function btn1Over(event:MouseEvent):void {}

    btn1.gotoAndPlay ("Over");

    }

    function btn1Down(event:MouseEvent):void {}

    btn1.gotoAndPlay ("Down");

    }

    function btn1Out(event:MouseEvent):void {}

    btn1.gotoAndPlay ("Out");

    }

    Btn1.addEventListener (MouseEvent.ROLL_OVER, btn1Over);

    Btn1.addEventListener (MouseEvent.ROLL_OUT, btn1Out);

    Btn1.addEventListener (MouseEvent.CLICK, btn1Down);

    And here is the error message:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    to openingscene_fla::MainTimeline/frame107()

    at flash.display::Sprite/constructChildren()

    at flash.display::Sprite()

    at flash.display::MovieClip()

    to openingscene_fla::home5_38()

    at flash.display::Sprite/constructChildren()

    at flash.display::Sprite()

    at flash.display::MovieClip()

    to openingscene_fla::cartoon2_33()

    at flash.display::Sprite/constructChildren()

    at flash.display::Sprite()

    at flash.display::MovieClip()

    to openingscene_fla::about1_28()

    at flash.display::Sprite/constructChildren()

    at flash.display::Sprite()

    at flash.display::MovieClip()

    to openingscene_fla::contact3_23()

    at flash.display::Sprite/constructChildren()

    at flash.display::Sprite()

    at flash.display::MovieClip()

    at openingscene_fla::donate4_18()

    donate4, about1, housecalls.5, contact3, cartoon2 is the buttons I use the YOU for. But what is the problem with him, I do not understand what meens sprite / cunstructChildren () for example?

    Please help me!

    If you show you get the error message, then it would be possible to help you find the problem.  If you do not, you already said enough you should be able to fix the problem yourself, but it is difficult to say if you understand what you are being told.

  • Problem with query select when the value is "I" or "II".

    Hello

    APEX 4.0.2

    I have a select as below,

    Select CLASS_TITLE
    of VW_TITLE
    where instr (upper ("CLASS_TITLE"), upper (nvl (DECODE (: P80_CLASS_TITLE, 'ALL', NULL,: P80_CLASS_TITLE), "CLASS_TITLE"))) > 0

    P80_CLASS_TITLE is defined as LOV. When I select "administrative specialist I" in the list, it returns the following.
    E specialist I
    Administrative Specialist II

    But if I select 'Administrative Specialist II', it returns only Administrative Specialist II.

    I only have this problem when there is an 'I' or 'II' in the CLASS_TITLE; Otherwise, it returns the correct values.

    Thanks a lot for your help.
    MT

    the mt user says:
    Sorry if I you confused. That's what I want the select statement to make. If I select a class title in the list of values, I want to display the title of the selected class. If I do nothing select in the list of values, then display all class titles in the table which is the default value.

    I assumed that "ALL" is the default value from the LOV. If the above does not work it appears that it must be null. So much more SQL 101:

    select
              t.class_title
    from
              vw_title t
    where
              t.class_title = :p80_class_title
    or        coalesce(:p80_class_title, 'ALL') = 'ALL'
    

    I'm guessing that you came with all the stuff INSTR/DECODE...

    You would probably enjoy taking up the + 2 day Developer Guide + brush on basic SQL.

  • I'm a noob and have problems with several buttons on the pages of menu bar

    Hi all

    I'm building a site of basic database for my local community, and everything is fine until I try to add more script for the command buttons on the pages in the menu. The menu has 7 buttons that work, then on each of these pages are more than 6 buttons. The first page works fine but when I add the code to the following page to control its buttons access of undefined prop. error and continues to play through any chronology. It's the im code using control buttons on the pages in the menu. If someone could help that would be great.

    Nothing particularly wrong with the code you show it, it is more likely a matter of trying to affect a bad code.  If you can view the actual error message you get can narrow the problem... before that if you go in your publish the Flash settings section and select the option to enable debugging, the error message will have a bit more info in there.

    If you can describe this scenario where you have other buttons on other pages as well as how these pages differ from each other, which can be useful as well.  What are all the labels image linked to... the main timeline?  Is - this code on the main timeline or in the pages?

  • Problems with duplicate DATA when the data file was added after the backup completes

    Hello

    I am facing a problem when running of duplicate database with the command of database duplicate RMAN on a 10 g database. If I have the duplication from a full backup that is missing a data file that has been added to the database after the full backup of preforms, I get the following error message:
    Starting restore at 10-10-2009 18:00:38
    
    released channel: t1
    released channel: t2
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 10/10/2009 18:00:39
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06026: some targets not found - aborting restore
    RMAN-06100: no channel to restore a backup or copy of datafile 43
    Redo log which was Pond at the time of the creation of 43 of the data file is also available in the backups. It seems that RMAN cannot use the log information archived redo to restore the content of the data file 43. I guess that because failure is already reported in the RESTORATION and not in the RECOVERY phase, so again the archived logs are not available yet. I get the same message even if I do another backup of the data file 43 (so a backup that is not in the same backupset as the backup to all the other data files).
    The script, the command duplicate product, I guess that RMAN reads the contents of the source database controlfile and trying to get a backup that contains all the data files to restore the database Assistant - if such a backup is not found, it fails.


    Of course, if I try to perform a restore/recovery of the source database, it works without problem:
    RMAN> restore database;
    
    Starting restore at 13.10.09
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=156 devtype=DISK
    
    creating datafile fno=43 name=F:\ORA10\ORADATA\SOVDEV\SOMEDATAFILE01.DBF
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00001 to F:\ORA10\ORADATA\SOVDEV\SYSTEM01.DBF
    .....
    The 43 data file is re-created and then redo is applied to the course.

    So, does anyone know if the duplicate database can use archived redo logs to recreate the contents of a data file, as does a normal restore/recovery? If this is the case, then it is necessary to perform a full backup before each duplicated if a data file has been added after such a backup database.

    Thanks in advance for any answers.

    Kind regards
    Swear

    Hi swear,.

    I got exactly the same problem during replication.
    Because we backup archive logs every 6 hours with rman, I added an additional block of running this script.
    run
    {
    backup incremental level 0
    format "% d_ % s_ %%t p_ bk_ '.
    filesperset 4
    database not saved;
    }

    (I also hit a bug in the catalogue which was resolved by patching up the dbs catalog 11.1.0.6, 11.1.0.7 for.)

    This will restrict the data not making file not part of any backup rman 6 hours while jumping for which there is already a backup of data files.

    Kind regards

    Tycho

  • I have problems with my computer when I put it to "sleep", that it comes back on after a minute. What can I do to fix this?

    To save energy and preserve the life of my monitor I put my computer in mode 'sleep', but the screen turns back on after about a minute or two.

    Hi Aaron,

    Have you tried the steps in the link on the previous post to solve the problem?

    It would be better if you can let us know the current state of this issue. We will be happy to help you.

Maybe you are looking for

  • Where the place / the field to enter the Web site I want to see from the opening

    I had put Mozilla in place to open the site start.earthlink.net . Now this isn't the case. What hit me out of this framework, and where can I find the dialog box reset to this place?

  • Satellite P200 - 1 K 9 and performance issue

    I hope IM this ad in the right area... Hello I have a Satellite P200 - 1 K 9 with the following specifications: Intel Core 2 Duo T7700 @ 2.40 GHz CPU3 GB RAM32 bitNote Windows experience 4.8 ATI Mobility Radeon HD 2600 map graphic and oneHD sound car

  • HP a367c XP family, upgrade to clean install of Vista. Firmware upgrade must be done again

    I have two questions to do a clean install of Vista family premium on my HP a367c desktop pc came with XP home installed. I wiped the cause of hard drive corruption 1. can I need to reinstall the firmware for a367c office updates, or others like bios

  • VI do not transfer data from the instrument.

    Hello to all who are interested.  I'm working on an instrument driver for an Agilent D3000A generator of signal (E4432A) trying to get the generator to sweep the amplitude of - 30dBm to-75dBm and then come back in a loop.  The loop is in a structure

  • problems with my computer

    I have a hp pavilion a819n and about 2 years ago my pc crashed and I had windows xp. my friend told me that his friend could fix. While he does and put windows xp professional on my pc. so now, many programs do not work. He also told me I couldn't do