How to "where any of(b,c,d,e,f,g,h..) is null" with SQL(not PL/SQL)

With the combinations of case, decode and coalesce function this can be done via pl/sql function, but is it possible to do it with SQL(any similar operator for this need I mean).
This need is because this is a report and the data processed is large so if this can be done within SQL engine it may help with performance.
Best regards.

I don't think coalesce is what you need, but maybe I'm missing something here.
You can use some nested nvl2 expression, but why doing it complicated. As s.rajaram says, using the or-operator will do just fine.
SQL> create table mytable
  2  as
  3  select 1 b, 1 c, 1 d, 1 e, 1 f, 1 g, 1 h from dual union all
  4  select 1, 1, 1, 1, null, 1, 1 from dual union all
  5  select null, null, null, null, null, null, null from dual union all
  6  select 1, null, 1, null, 1, null, 1 from dual
  7  /
Tabel is aangemaakt.
SQL> select b, c, d, e, f, g, h
  2       , coalesce(b,c,d,e,f,g,h)
  3       , nvl2(b, nvl2(c, nvl2(d, nvl2(e, nvl2(f, nvl2(g, h, null), null), null), null), null), null) anyone_null
  4    from mytable
  5  /
B  C  D  E  F  G  H COALESCE(B,C,D,E,F,G,H) ANYONE_NULL
1  1  1  1  1  1  1                       1           1
1  1  1  1     1  1                       1
1     1     1     1                       1
4 rijen zijn geselecteerd.
SQL> select b, c, d, e, f, g, h
  2    from mytable
  3   where nvl2(b, nvl2(c, nvl2(d, nvl2(e, nvl2(f, nvl2(g, h, null), null), null), null), null), null) is null
  4  /
B  C  D  E  F  G  H
1  1  1  1     1  1
1     1     1     1
3 rijen zijn geselecteerd.
SQL> select b, c, d, e, f, g, h
  2    from mytable
  3   where b is null
  4      or c is null
  5      or d is null
  6      or e is null
  7      or f is null
  8      or g is null
  9      or h is null
10  /
B  C  D  E  F  G  H
1  1  1  1     1  1
1     1     1     1
3 rijen zijn geselecteerd.Regards,
Rob.

Similar Messages

  • How to combine multiple columns into one column and delete value the row (NULL) in sql server for my example ?

    My Example :
    Before:              
    Columns
    name               
    address          
                   jon                      DFG
                   has                     NULL
                   adil                      DER
    After:                  
    Column 
                                    Total   
                      name : jon , address : DFG
                      name : has
                      name : adil , address : DER

    Why not doing such reports on the client site?
    create table #t (name varchar(10),address varchar(20))
    insert into #t values ('jon','dfg'),('has',null),('adil','der')
    select n,case when right(n,1)=':' then replace(n,'address:','') else n end
    from
    select concat('name:',name, ' address:',address  ) n from #t
    ) as der
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How do I get slides to print full size? They are currently printing with speaker notes

    Trying to print my keynote presentation and the slide printouts are being shrunk to appropriate size when using speaker notes. Can someone help me get the settings resized to print full size?

    When you select 'print', a dialog box should open & one of the options under 'print' should be 'individual slides'.  This should print the slide as a whole page.

  • How InDesign comes to know about any changes on document, but not saved. As it shows * on the name of document when it is opened and any changes. And after saving * symbol is get removed from the name of document. How and where indesign@ handles this?

    How InDesign comes to know about any changes on document, but not saved. As it shows * on the name of document when it is opened and any changes.
    And after saving * symbol is get removed from the name of document. How and where indesign@ handles this?

    Are you just asking because you want to know, or do you have a problem you need to solve? I don't know how to write a program, but I think what your are describing is not an unusual thing for a  program to do. The * tells you that changes have been made since the last save, and the program reserves a portion of memory for undo functions. I suppose a coder could tell you how it works, but I don't think it would help an average user to know, but that's just my opinion.

  • How and where can I submit a bug report to Nokia ?

    How and where can I submit a bug report to Nokia ? I haven't found any Nokia's webpage where it is explained.

    wait for the next nokia beta test program (they usually annouce it on this forum) and enrol
    then you will have access to the developers to report bugs
    the last beta test finished end of November.. so it will be a while b4 the next beta test
    cheers
    Nokia N95 8GB, 6234, 6101, N-Gage Classic, 8250, 3350, 3315

  • In the libary of iPhoto I do have double pictures only in the year 2006. Can someone please tell me how to remove the double pictures. I did rebuilt the libary but that solution did not help me any further.

    In the libary of iPhoto I do have double pictures only in the year 2006. Can someone please tell me how to remove the double pictures. I did rebuilt the libary but that solution did not help me any further.

    I think the warning is very clear.
    What warning? Where do you say that this plan you suggest will lose at least some, and possibly a whole lot of metadata, plus  the original files of edited photos. This is significant dataloss. And you should warn people that this is the case.
    While your metadata and originals may not be important to you, that is not necessarily the case for other users.
    Fourthly, and last, cleaning the iPhoto library should be done at least once per year
    This is nonsense. The iPhoto Library has no need of "cleaning" and certainly not in any way that trashes a whole lot of data.
    I'm very impressed that you assess the application based on the sound of the name. It's not a common way to review applications, but I'm sure it has some merit.
    FWIW it has been recommended on this - and other - sites for many years and has proven safe and effective.
    Regards
    TD

  • How to make any object self-shining?

    hi,
    i guess thats an easy question, but i dont know where to look for the answer.
    so how to make any object self-shining like the infamous colorcube, so that one does not need to place any light?
    and am I right in my assumption that doing so will reduce the need of rendering power, since lights dont have to be computed?
    thanx,
    Usul

    I'm not sure what you mean here- if your object is lit then lighting will need to be calculated. If you don't want shapes to be lit, I think you can disable it by calling setLightingEnable(false) in their materials.

  • How and where to add code to login page

    I have a login page which uses the Dreamweaver Login Behavior.  I want to add code to:
         Check the status of the person loging in (status is the last field in the mySQL authentication table).
              a.     If the person is already logged in, display an error message, and reject the attempt.
              b.     If the person is NOT currently logged in, set his status accordingly, and log him in.
    Since the behavior is generated code, and well above my head, I don't know what code to enter, and where to enter it.  Here's the code for the form:
    <?php require_once('Connections/login.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (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 "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['username'])) {
      $loginUsername=$_POST['username'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "WOTCPg1.php";
      $MM_redirectLoginFailed = "loginerror.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_login, $login);
      $LoginRS__query=sprintf("SELECT UserID, Password FROM authentication WHERE UserID=%s AND Password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $login) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;      
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript">
    function setFocus()
    document.getElementById("username").focus();
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Log-in to IOD</title>
    <style type="text/css">
    <!--
    #apDiv3 {
    position:absolute;
    left:5px;
    top:101px;
    width:760px;
    height:612px;
    z-index:2;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    color: #009;
    text-align: center;
    background-image: url(images/grid_gray.gif);
    border: medium ridge #009;
    #apDiv1 {
    position:absolute;
    left:94px;
    top:227px;
    width:629px;
    height:282px;
    z-index:3;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    font-variant: normal;
    text-transform: none;
    color: #009;
    text-align: center;
    #apDiv2 {
    position:absolute;
    left:178px;
    top:248px;
    width:564px;
    height:254px;
    z-index:3;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    font-variant: normal;
    text-transform: none;
    color: #009;
    text-align: left;
    border: medium groove #036;
    #apDiv4 {
    position:absolute;
    left:178px;
    top:245px;
    width:566px;
    height:242px;
    z-index:3;
    border: medium groove #009;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    font-variant: normal;
    text-transform: capitalize;
    color: #009;
    .SubmitButton {
    color: #009;
    -->
    </style>
    </head>
    <body onLoad="setFocus()" >
    <span style="position:absolute; left:3px; top:2px; width:758; height:89;"><img src="sitebuilder/preview/sitebuilder/clipart/bars/regular/horizontal/sleekLines_blue.gif" width="760" height="90" alt="" /></span>
    <div id="e2" style="position:absolute; left:13px; top:14px; width:670px; height:32;"><span class="text"><b><span style="font-size: 22px"><font color="#FFFFFF">Sign-in to Information On Demand</font></span><font color="#FFFFFF" size="4"><span style="font-size:22px;line-height:26px;"><br soft="soft" />
    </span></font></b></span></div>
    <div id="apDiv3">
      <p><span style="text-align: center; text-decoration: underline; color: #009; text-transform: capitalize; font-variant: normal; font-weight: bold; line-height: normal; font-style: normal; font-size: 18pt; font-family: Arial, Helvetica, sans-serif;">Customer Sign-In</span><span style="position:absolute; left:12px; top:23px; width:151px; height:65;"><img src="sitebuilder/images/redInfoOnDemandLogo-150x65.jpg" width="149" height="65" alt="" /></span></p>
    </div>
    <div id="apDiv4">
    <form ACTION="<?php echo $loginFormAction; ?>" id="login" name="login" method="POST">
        <p>     </p>
        <p>User Name:<br /><input name="username" type="text" id="username" tabindex="1" size="30" maxlength="30" />
        </p>
        <p>User's Password:<br />
          <input type="password" name="password" id="password" tabindex="2" />
        </p>
        <p>
          <input name="submit" type="submit" class="SubmitButton" id="submit" tabindex="3" style="color:#009; font-weight:bold" value="Sign-in" />
       <input type="reset" name="reset" id="reset" value="Reset" tabindex="4" style="color:#009; font-weight:bold">
        </p>
      </form>
    </div>
    <br />
    </div>
    </body>
    </html>
    Here's the code for the script "included" in the first line of the page:
    <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_login = "localhost";  // Change to "mysql" when uploaded to Yahoo
    $database_login = "infoondemand";
    $username_login = "root";   // Change to "creacontech" when uploaded to Yahoo
    $password_login = "raisin4312";
    $login = mysql_pconnect($hostname_login, $username_login, $password_login) or trigger_error(mysql_error(),E_USER_ERROR);
    ?>
    Could someone help me with this?  I'd very much appreciate any assistance.

    I should have warned you ealier that I don't know PHP very well, but if I can help nail down the process then hopefully one of the PHP experts can jump in.
    I'm still a little fuzzy on what is going on.  If Susie and Rodunda both have their own UserIDs and Passwords, then they can both be logged in at the same time, insert records til their hearts content and there will be abolutely no confict at all. The only issue here that may present a problem is if one of them attameps to update a record while the other one is looking at it, or getting ready to make their own modifications.
    Also, if Susie and Rodunda have their own user accounts with their own credentials, how is it that one would try to log in using the others' credentials?
    At any rate, and hopefully to get closer to a solutions for you, When a user is successfully authenticated, the session variable MM_Username is created.  So, simpy by checking for the existence of this session variable can tell you if that use is logged in or not.  This check can be placed before any of the login script so that it doesn't interfere with the behavior generated code. And you can choose what to do depending on the condition that exists - such as redirecting immediately to another page, or displaying or hiding a certain region on the page.
    Keep in mind that when the page first loads, thel login code is placed in an IF statement that checks the form action, so at first it's ignored and loads the form.  When the form is submitted, the IF conditino is met and the code executes.  To update the database with a "Logged in or out" value, you first have to place a recordset just after the IF statement that checks the form action, wirte another IF statement to check the value of the field, and then redirect to a logout page or continue with the login.
    If you continue with the login, you'll need an Update statement to change the field in the database just before the successful redirect.  If you've redirected to a log out page, you'll also need s similar update statement there.
    To write the recordset code, you can use DW's wizard and just move the code to where it needs to go. But the DW's update code depend on predeifned recordsets and form actions, so you'll need to find a script or hand code it, I wouldn't recommend trying to use DW's code and then modify it.
    So, what do you think, are we getting closer?

  • How and where to checkin service bus module.

    Hello Geeks,
    I am a newbie to Oracle Service Bus and trying to learn it.
    Today i have developed my first service bus application and I am also able to deploy it.
    As a deployment artifact , I am having sbconfig.jar.
    My module contains 1 proxy , 1 business service and few xsd.
    My question is
    1.) what is the standard practice for checking service bus applications .?
    2.) Where we checkin these files and how. ?
    3.) do i have to checkin the sbconfig.jar itself in the repository. ?
    Please help.
    Cheers
    SJ

    > do i have to checkin the sbconfig.jar itself in the repository. ?
    No, this is a derived artifact, and shouldn't be checked into any VCS(*)
    You check in the source files -- *.proxy, *.biz, *.xsd and so on, and also the content of the DevConfiguration folder.
    P.S. Granted, those files are XML and branching and merging is a MAJOR PAIN in OSB, but this is the best you can do.
    (*) Unless it is the Release Management VCS where they often require to drop the deployable artifact into there, because they are not very interested in sources when promote the code to PROD.

  • How to calculate any two date with diffence calculation by using obiee11g?

    Hi,
    i have a requirement like,
    location wise current month and previous month with movement calculation,can to tell me how to calculate any two date with diffence calculation
    by using obiee11g
    Note,
    I tried to implemented ago function as well as dynamic two dates calculation using $2-$1 methods..but i am getting the o/p it's self i am getiing some null value also that' why it's not tallying with our actual report.
    i tired to used ifnull(mesaurecolumn,0) also case condition on the mesaure colution still it's not tallying.
    THanks and Rds,
    Devarasu.R

    Hi,
    for Date Difference........
    TimestampDiff(interval, timestamp1, timestamp2)
    ex:TimestampDiff(SQL_TSI_DAY, cast('1-apr-2011' as date), current_date)
    Where:
    interval
    The specified interval. Valid values are: SQL_TSI_SECOND, SQL_TSI_MINUTE, SQL_TSI_HOUR, SQL_TSI_DAY,
    SQL_TSI_WEEK, SQL_TSI_MONTH, SQL_TSI_QUARTER, SQL_TSI_YEAR.
    Cheers,
    Aravind

  • How  and where does SAP standard programs update the master tables...

    Hello there,
    How  and where does SAP standard programs update the master tables...
    to be precise.. if a (any) transaction occurs  the programs behind it holds the data in temporary structures.
    where and when does it get updated in the master table.
    can anyone tell me how it happens?
    I Know that from the where used list one can find the corresponding table but most of the time it wont suffice
    I am expecting a proper answer.
    Santosh B

    Hello Santosh,
    you need to do some self-reading on the following topic
    Updates in the SAP System (BC-CST-UP)
    http://help.sap.com/saphelp_47x200/helpdata/en/e5/de86e135cd11d3acb00000e83539c3/frameset.htm
    Regards,
    Siddhesh

  • How and where to  check Patch level in XI

    Hi,
    Can any one let me know how and where to  check Patch level for  XI systems.
    Ex: 14SAPXIAFC17P_14.sca
    Also pls provide me with the procedure for applying  above patch.
    Shavali

    Hi Shavali -
    http://<host>:<j2ee_http_port>/sap/monitoring/ComponentInfo
    also
    http://<host>:<j2ee_http_port>/sap/monitoring/SystemInfo for core system info (J2EE or JVM patch level, etc.)
    BTW, you need <i>SAP_J2EE_ADMIN</i> role for this.
    Regards,
    Jin

  • I DON'T KNOW HOW TO GET ANY RADIO STATIONS ON MY I-POD, PLEASE HELP!!!!!!!!

    I DON'T KNOW HOW TO GET ANY RADIO STATIONS ON MY I-POD, PLEASE HELP!!!!!
    ON THE I-TUNES PROGRAM WHERE THERE IS A LISTING OF INTERNET RADIO STATIONS, I HAVE TRIED TO ADD STATIONS TO MY I-POD CLASSIC, BUT NOTHING HAS SHOWN UP ON MY I-POD & I DON'T KNOW WHAT ELSE TO DO...
    DOES ANYONE KNOW HOW TO ADD INTERNET RADIO STATIONS FROM I-TUNES ONTO THE I-POD CLASSIC????
    PLEASE I REALLY NEED SOME HELP WITH THIS & I DON'T WHERE ELSE TO TURN TO BECAUSE I HAVE LOOKED IN THE SUPPORT & HELP SECTIONS & THERE IS ABSOLUTELY NOTHING MENTIONED ON THIS TOPID THAT IS ANYWHERE USEFUL TO ME, PLEASE HELP!!!!!!!!! THANK YOU SOOOO MUCH!!!

    Please don't type in all caps... I get a headache trying to read it.
    The Internet radio in iTunes works because you have an Internet connection.
    Your iPod classic does not have an Internet connection. It's just a media player. Therefore, there is no way to put Internet radio on an iPod classic.
    If you want to play regular (over the air) FM radio on your iPod classic, you can use the iPod radio remote control.
    http://store.apple.com/us/product/MA070G/D

  • How and where improve my photoshop skill shortly? be more professional !

    One of my job duty is web graphic
    i use photoshop mainly during my working time
    but my skill was not upgraded for 1-2 years , just repeat daily work only
    how and where improve my photoshop skill within 1-2 week?  And be more professional !
    for example , i respond for a fashion jewelry shop :  www.gemztone.com
    the boss request me to do more improvment but i have no good idea,
    Thank you any suggestion!

    I see that Lynda.com has gotten a lot of recs, so will not mention that one (good though).
    I also like the Adobe Classroom in a Book [fill in your version of PS here], Adobe Press. They will step you through several interesting projects, and expose you to much that is contained in the program. Most will also provide you with sample images to work with. To date, only CiaB Encore, was without sample files.
    Early editions did concentrate heavily on the "how," but were lacking the "why." Most of the versions that I have seen lately, have added a lot more of the "why," and that can be so very important, when one translates their lessons to real-world work.
    After that, there are many fairly specialized books for PS. Ones for a Camera RAW flow, retouching, 3D, motion in PS-Extended, and on, and on. Once you are comfortable with the program, define what you want to do with it. There will likely be a book for that.
    Good luck and enjoy,
    Hunt

  • How and where do I install a wireless internet card in G3 PowerBook?

    I own a G3 PowerBook "Pismo", Firewire, M7572. Not being familiar with working with the internals of a laptop, how and where does one install wireless internet card? Any help would be appreciated

    The G3 Powerbook "Pismo" takes an original Apple Airport Card, and NOT the extreme card. The original airport card is available here:
    http://www.macwireless.com/html/products/wirelesscards/11g_11bcards/airportcard.php
    http://www.ifixit.com/Apple-Parts/Airport-Card/IF143-010
    http://www.quadmation.com/AIRPORT.cardonly/
    http://www.powerbookmedic.com/Apple-Airport-Card-80211b-p-16144.html
    http://www.a1acomputing.com/usorapaicam7.html
    Installation instructions are here, if you are adventurous:
    http://www.ifixit.com/Guide/Mac/PowerBook-G3-Pismo/Airport-Card/6/3/Page-1

Maybe you are looking for

  • Remote app - constantly reconnecting, can't get it to stop

    Any ideas? I took the Remote app for a dry run, and everything worked fine - I really like it. Next, I bought an Airport Express. I'm still working out problems, but that's another post in another area... The problem now is, I can get iTunes playing

  • Volume problems with Adobe Flash Player 11.5 r502

    Hello, Whenever I used to watch Youtube or other video through Firefox, my volume would remain at whatever volume I had set for Firefox in my Volume Mixer.  The last few iterations of Firefix (currently 17.0.1), however, have seen a new item, "Adobe

  • Material blocked due to a physical inventory - VL02N - Post Goods Issue

    Hi, We are working with SAP R/3 4.6C IDES. During a business process we need to run VL02N and to click the Post Goods Issue button. When we do that, we are getting the following error: "Material P-103 1000 0001 blocked due to a physical inventory" An

  • About Oracle  Reports very urgent

    can you pls explain me about what isOracle reportcaching,interactivereports and batched reports.

  • Firefox errors when in outlook webmail

    When any of the users on my network open Outlook webmail through Firefox, they are experiencing the error below (randomly throughout the day). When you try to close the error, it does not go away. F5 will clear the error so they can continue to work,