Can any one help with this query please

I have a table something as below
Things_t
Things Characteristic Char Value
Item 1 Colour Red
Item 1 Packaging
Item 2 Shape Square
Item 2 Brand Spunk
Now i want to reterive an item with none of its char values as Null. Using the query “ select distinct things from things_t where char value is Null ” will fetch the item 1 also together with item 2. i want to fetch a record from thing for which none of the char values are Null such as Item 2. Can you please help me with this query.

Try this:
WITH t AS
(SELECT 1 item_id, 17436 chr_id, 14225034 chr_val_id FROM dual UNION
SELECT 1 item_id, 39 chr_id, 14276173 chr_val_id FROM dual UNION
SELECT 1 item_id, 17774 chr_id, NULL chr_val_id FROM dual UNION
SELECT 1 item_id, 265 chr_id, 20502978 chr_val_id FROM dual UNION
SELECT 1 item_id, 16978 chr_id, 797233 chr_val_id FROM dual UNION
SELECT 1 item_id, 13092 chr_id, 5666917 chr_val_id FROM dual UNION
SELECT 1 item_id, 15228 chr_id, 1209758 chr_val_id FROM dual UNION
SELECT 2 item_id, 112 chr_id,  12705342 chr_val_id FROM dual UNION
SELECT 2 item_id, 6945 chr_id, NULL chr_val_id FROM dual UNION
SELECT 2 item_id, 70 chr_id, 12597376 chr_val_id FROM dual UNION
SELECT 2 item_id, 16832 chr_id, NULL chr_val_id FROM dual UNION
SELECT 2 item_id, 7886 chr_id, 9588619 chr_val_id FROM dual UNION
SELECT 2 item_id, 6986 chr_id, 2659351 chr_val_id FROM dual UNION
SELECT 3 item_id, 9531 chr_id, 8910943 chr_val_id FROM dual UNION
SELECT 3 item_id, 9798 chr_id, 8717531 chr_val_id FROM dual UNION
SELECT 3 item_id, 17446 chr_id, 12266441 chr_val_id FROM dual UNION
SELECT 3 item_id, 4830 chr_id, 13683090 chr_val_id FROM dual UNION
SELECT 3 item_id, 9518 chr_id, 834772 chr_val_id FROM dual UNION
SELECT 3 item_id, 11031 chr_id, 20233753 chr_val_id FROM dual UNION
SELECT 3 item_id, 12564 chr_id, 2282478 chr_val_id FROM dual)
SELECT DISTINCT item_id
FROM   t
MINUS
SELECT DISTINCT item_id
FROM   t
WHERE  chr_val_id IS NULLOr this:
SELECT item_id
FROM  (SELECT   item_id,
                MIN(NVL(chr_val_id, -1)) min_chr_val_id
       FROM     t
       GROUP BY item_id)
WHERE  min_chr_val_id != -1Edited by: lee200 on Oct 15, 2012 9:22 AM

Similar Messages

  • TS1424 IPOD WONT CONNECT TO ITUNES STORE I'VE TRIED EVERYTHING EVEN RESTORED BACK TO FACTORY DEFAULT, CAN ANY ONE HELP WITH THIS

    Every time I try to get on itunes store on my ipod it tells me that it "cannot connect to itunes store", I've tried everything even restored the ipod to factory settings and nothing, can some one please give a solution that will work?

    Hi datnativeBUNNZ,
    If your iPod can't connect to the iTunes store, check out this article for some additional troubleshooting steps:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    Troubleshooting on an iPhone, iPad, or iPod touch
    If you haven't been able to connect to the iTunes Store:
    Make sure that your iOS software is up to date by connecting your iOS device to iTunes and clicking on Check for Update in your device's Summary page in iTunes.
    Check and verify that you are in range of a Wi-Fi router or base station. If you are on a 3G capable device, make sure that cellular data is turned on from Settings > General > Cellular.
    Note: If connected to 3G, larger items may not download. You may need to connect to Wi-Fi to download apps, videos, and podcasts. 
    Check to make sure you have an active internet connection. You can check the User Guide for your device for help with connecting to the internet. 
    Check to make sure other devices (portable computers, for example) are able to connect to the Wi-Fi network and access the internet.
    Try resetting (turning off and then on again) your Wi-Fi router
    If the issue still persists see, iOS: Troubleshooting Wi-Fi networks and connections or iOS: Troubleshooting Wi-Fi networks and connections.
    Take care!
    - Ari

  • Hi i am unable to send mail from yahoo mail id.can any one help on this?

    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.io.*;
    import java.util.Properties;
    public class MailClient
      public void sendMail(String mailServer, String from, String to,
                                 String subject, String messageBody,
                                 String[] attachments) throws
    MessagingException, AddressException
             // Setup mail server
             Properties props = System.getProperties();
             props.put("mail.smtp.host", mailServer);
             // Get a mail session
             Session session = Session.getDefaultInstance(props, null);
             // Define a new mail message
             Message message = new MimeMessage(session);
             message.setFrom(new InternetAddress(from));
             message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
             message.setSubject(subject);
             // Create a message part to represent the body text
             BodyPart messageBodyPart = new MimeBodyPart();
             messageBodyPart.setText(messageBody);
             //use a MimeMultipart as we need to handle the file attachments
             Multipart multipart = new MimeMultipart();
             //add the message body to the mime message
             multipart.addBodyPart(messageBodyPart);
             // add any file attachments to the message
             addAtachments(attachments, multipart);
             // Put all message parts in the message
             message.setContent(multipart);
             // Send the message
             Transport.send(message);
         protected void addAtachments(String[] attachments, Multipart multipart)
                         throws MessagingException, AddressException
             for(int i = 0; i<= attachments.length -1; i++)
                 String filename = attachments;
    MimeBodyPart attachmentBodyPart = new MimeBodyPart();
    //use a JAF FileDataSource as it does MIME type detection
    DataSource source = new FileDataSource(filename);
    attachmentBodyPart.setDataHandler(new DataHandler(source));
    //assume that the filename you want to send is the same as the
    //actual file name - could alter this to remove the file path
    attachmentBodyPart.setFileName(filename);
    //add the attachment
    multipart.addBodyPart(attachmentBodyPart);
    public static void main(String[] args)
    try
    MailClient client = new MailClient();
    String server="pop3.yahoo.com";
    String from="[email protected]";
    String to = "[email protected]";
    String subject="Test";
    String message="Testing";
    String[] filenames = {"c:\\gopi.txt"};
    client.sendMail(server,from,to,subject,message,filenames);
    catch(Exception e)
    e.printStackTrace(System.out);     
    while compliling this one its compiled succesfully but i am getting exception at run time like..D:\mail>java MailClient
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/activation/re
    gistries/MailcapFile
    at javax.activation.MailcapCommandMap.loadFile(MailcapCommandMap.java:275)
    at javax.activation.MailcapCommandMap.<init>(MailcapCommandMap.java:128)
    at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:44)
    at javax.activation.DataHandler.getCommandMap(DataHandler.java:136)
    at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:568)
    at javax.activation.DataHandler.getContent(DataHandler.java:501)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1253)
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2012)
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1980)
    at javax.mail.Transport.send(Transport.java:97)
    at MailClient.sendMail(MailClient.java:35)
    at MailClient.main(MailClient.java:72)
    can any one help on this....plz
    thanks in advance
    Edited by: Konapalli.Gopi on May 20, 2010 5:42 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Something's wrong with your CLASSPATH.
    If you're not using JDK 6, you need to include activation.jar in your CLASSPATH.
    If you've got any other jar files that define the javax.mail.* or javax.activation.* classes
    in your CLASSPATH (such as javaee.jar or j2ee.jar), remove them.

  • Have just down loaded Yosemite over Mountain Lion, Indesign CS5 does not work ( Am dependant on it) although Bridge , Light Room and Elements operate OK How do I solve this rapidly. Can any one help on this issue. Thanks

    Have just down loaded Yosemite over Mountain Lion, Indesign CS5 does not work ( Am dependant on it) although Bridge , Light Room and Elements operate OK How do I solve this rapidly. Can any one help on this issue. Thanks

    Sorry to say it, but I think you can see from Bob's response that there's no way to solve this rapidly.
    Did you take an image of your Mountain Lion install before upgrading to Yosemite? Roll back to that. If you're not in the habit of taking a snapshot of your system before performing operating system upgrades - get in that habit. If you are dependent on anything at all on hour computer, having a reliable backup method in place is essential. If you don't have a Time Capsule, or some other way to run Time Machine onto a disk that's not in your computer, go set that up yesterday.
    If you can't just remove Yosemite and roll back to Mountain Lion for whatever reason, you can partition your drive so that you can install both Yosemite and Mountain Lion on the same drive, and then boot into Mountain Lion when you need to work in CS5. Or you can take your Mountain Lion disc (I assume you have one, no?) and then use it to create a virtual machine in something like VirtualBox to run Mountain Lion from inside Yosemite.

  • Can any one help with new iOS 7.1 update?

    Hello,
    I have recently downloaded the iOS 7.1 update and it has being causing problems with the iPhone 4s. The problems are as follows;
    No Wi-Fi connection all, and in full range of a connection (If and when I connect its for 10 seconds and gone again)
    Battery Life depleting quickly
    iPhone freezes constantly
    iPhone getting extremely hot when not in use.
    Is there anything that I can do that can help with this or will I have to wait for the next iOS update?
    Kieran

    If I restore as new without the backup & everything seems to be fine, I assume I would then have to restore it from my latest backup in iTunes in order to get all (or at least most) of my data back.
    From what I have read, it looks like at least the music I have on my iPhone 4S that I put there from a CD I own would not be in my backup.  That is not a major problem, since it is only 1 CD.
    It also seems like the iTunes backup is more complete than the iCloud backup (I do have both).
    So, I should probably be restoring from that backup.
    Is there anything else that is not backed up in an iTunes backup that I should consider before I do that?
    When I backup in iTunes (or even in iCloud), some items not backed up?
    Wouldn't I then have to re-install those items that are not in my backups?
    I have a Medical app from my local ambulance operator where I have taken a ton of time to input all of my medical information going back numerous years.  I just got tired of some medical person constantly asking me for information one never really makes a point of remembering.  Now, I have all of that information in my iPhone 4S.
    There is no way I would want to reinstall that app & re-input all of that information again.
    I also put a lot of "lists" in the Notes area on my iPhone 4S.
    I understand that is also something that is not backed up.
    These are just 2 examples.
    I also have other items that I am under the impression also are not backed up.
    Losing any of that information would be a huge burden to recover.
    I am willing to take a chance with some items that are not backed up to either iTunes nor iCloud.
    But, knowlingly doing something that may lose that information is not something I am willing to do.
    OR, am I just not understanding what is and is not backed up in iTunes or iCloud & what I could potentially lose?

  • Hi can any one help with solving this problem

    Hi Every body,
    I had an xml file ,with using parser i want to read the xml file ,but in my xml file i had an error "&data_12546_norm_589567;"
    To process this error and read the xml file content in java file.
    How can i read the xml file.
    My xml file is this
    <?xml version="1.0" encoding="UTF-8"?>
    <Student>
    <Name initials="KRONI">
    <Softwaredepartment/>
    </Name>
    &data_12546_norm_589567;
    </Student>
    Thanks in advance
    regards
    Ram

    You have to replace & with &amp;Like below
    <?xml version="1.0" encoding="UTF-8"?>
    <Student>
    <Name initials="KRONI">
    <Softwaredepartment/>
    </Name>
    &amp;data_12546_norm_589567;
    </Student>

  • Can any one help on this error in CRM ui 7.0

    Dear Experts,
    here i have problem with component : bp_head_serach - view: mainsearchresult.
    my intention is add one field to customer. IDNUMBER from but0id.
    i have done the configuration part and already added the IDnumber in UI screen using cinfig.
    and (ZL_BP_HEAD__MAINSEARCHRES_IMPL)append the structure also. please help me guys.
    structed from past 5days.
    data: lv_bpid type BU_ID_NUMBER.
    data: lv_bp_str type string.
    data: lv_bp type BU_PARTNER.
    if value  is initial.
      lv_bp_str = current->get_property_as_string( 'BP_NUMBER' ).
        if lv_bp is not initial.
        lv_bp = lv_bp_str.
        select single IDNUMBER from but0id into lv_bpid
            where partner = lv_bp.
        if sy-subrc = 0.
          value = lv_bpid.
          endif.
        endif.
    endif.
    this is the code am using in get_zzbp_id.

    Hi,
    If your select query fails then its because of the missing conversion exit, since you are reading bp number as a string.
    Use get_property_As_value instead of reading as string.
    Try this,
    data: lv_bpid type BU_ID_NUMBER.
    data: lv_bp type BU_PARTNER.
    if value is initial.
    current->get_property_as_value( exporting iv_attr_name = 'BP_NUMBER'
                                                           importing ev_result = lv_bp ).
    if lv_bp is not initial.
        select single IDNUMBER from but0id into lv_bpid
                                                where partner = lv_bp.
         if sy-subrc is initial.
               value = lv_bpid.
         endif.
    endif.
    endif.
    Regards,
    Arun

  • SQL I need help with this query Please help

    List the names of all the products whose weight unit measure is “Gram”.  Order the list by product name.  Do not use JOINS, but use the IN clause with a sub-query.
    select Name
    from UnitMeasure
    where Name= 'Gram'
    order by Name
    I did this, but it seem that the requirement is different.

    As a guess:
    Select Name from Product
    where UnitMeasure in (Select Name from unitmeasure where name = 'Gram')
    Andy Tauber
    Data Architect
    The Vancouver Clinic
    Website | LinkedIn
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • Can any one help with poor LTE connection with new iPad?

    I wrote yesterday about my new iPad 4g LTE. I have it in Verizon and I am using it from home which is only 3G Verizon coverage. Often, ( like every minute), it will lose all ability to use the cellular connection. I will then have to wait for about another minute for the service to come back. Is this a Verizon issue or the iPad itself?
    Also, went thru  a 4g area while on the interstate and would completely lose connection around corners, etc. can the iPad not use 3G towers and 4g towers back and forth? Really upset about this! Anyone else having this issue? Help!

    If I restore as new without the backup & everything seems to be fine, I assume I would then have to restore it from my latest backup in iTunes in order to get all (or at least most) of my data back.
    From what I have read, it looks like at least the music I have on my iPhone 4S that I put there from a CD I own would not be in my backup.  That is not a major problem, since it is only 1 CD.
    It also seems like the iTunes backup is more complete than the iCloud backup (I do have both).
    So, I should probably be restoring from that backup.
    Is there anything else that is not backed up in an iTunes backup that I should consider before I do that?
    When I backup in iTunes (or even in iCloud), some items not backed up?
    Wouldn't I then have to re-install those items that are not in my backups?
    I have a Medical app from my local ambulance operator where I have taken a ton of time to input all of my medical information going back numerous years.  I just got tired of some medical person constantly asking me for information one never really makes a point of remembering.  Now, I have all of that information in my iPhone 4S.
    There is no way I would want to reinstall that app & re-input all of that information again.
    I also put a lot of "lists" in the Notes area on my iPhone 4S.
    I understand that is also something that is not backed up.
    These are just 2 examples.
    I also have other items that I am under the impression also are not backed up.
    Losing any of that information would be a huge burden to recover.
    I am willing to take a chance with some items that are not backed up to either iTunes nor iCloud.
    But, knowlingly doing something that may lose that information is not something I am willing to do.
    OR, am I just not understanding what is and is not backed up in iTunes or iCloud & what I could potentially lose?

  • Can any one help with advice on how to re-establish a wifi connection with my 3gs?

    Up until yesterday I never had any problems at all.  I have followed various suggestions from apple forums and teh closest I can get is that it is trying to connect but it never does and teh blue tick never appears.  I can join other networkd but not the wifi one I want to.

    stevenpm1uk wrote:
    it's a shame that with all the tec they put on the iphone the forget to put some thing as easy and uesfull as auto-answer.
    No, its like a chocolate teapot - nice sounding idea but of no use to 99.9% of the user base IMO. Having a touch screen and auto-answer is a route to major annoyance to most people.
    I vote for not providing it - ever

  • Can any one help with restoring an iPad 3?

    I know this sounds crazy but I recently installed an Airport express and an Airport Extreme, I worked on it for several days and everything seemed to finally working like it should using manual configurations so it is all right as far as function goes. Later on I found out I had to do a restore on my new IPod and the latest iPad. No other changes were made to the system using snow lepoard 10.6. I tried for several days to restore these devices with no explanation of the problem. I could not use wi-fi or cellular to update any of the devices. Don't ask me why but I shut the computer down and removed every usb device except for the wireless key board that came with the latest iMac system. I made sure everything was the latest version of my applications. It did not affect my DSL or connection to the internet. I even removed the thunderbolt cable so I had 1 usb connection to the computer. The system was setup just like it came out of the box. I brought up iTunes and connected the USB cable to the iPad and selected restore. I had used iCloud to back everything up when I first bought the iPad and iPod. I also made sure iOS 6 was installed. I clicked restore and it loaded without any problem in just a few seconds without having to sync anything. I checked when it was done and it worked exactly like it did when I first bought them from Apple. The only strange thing that happened was I purchased a brand new generation iPod from Apple (which was made in China). I had not installed any apps for several weeks and had no problem with them. This seems crazy to me that you would have to reset he computer to it's original setup in order to restore the latest iPad and iPod software and devices. The only item that I did not have any problem with was the iPhone. Has anyone had this problem? If so how did you deal with it. Was it the airports, made in China the new iOS or the new iTunes that is causing this? gillie70
    iMac, Mac OS X (10.6.7)

    iPad: Basic troubleshooting
    http://support.apple.com/kb/TS3274
    iOS: Resolving update and restore alert messages
    http://support.apple.com/kb/TS1275
    iPad: Unable to update or restore
    http://support.apple.com/kb/ht4097
     Cheers, Tom

  • Help with this query please

    Hi there, 
    These are the sample values
    declare @table table
    Name varchar(50),
    flag int
    insert into @table
    values('Matt', 0),
    ('George', 0),
    ('George', 1),
    ('Lucas', 0),
    ('Jerome', 0),
    ('Jerome', 1)
    I want to select out where George and Jerome where flag = 0 but leave the records from the same names where flag = 1. All others that only have flag = 0, should stay. So only the names that repeat and have both flag, flag = 0 zero should be selected out.
    Thanks for your help.

    So desired output is ????
    George 0
    Jerome 0
    declare @table table
    Name varchar(50),
    flag int
    insert into @table
    values('Matt', 0),
    ('George', 0),
    ('George', 1),
    ('Lucas', 0),
    ('Jerome', 0),
    ('Jerome', 1)
    select name,min(flag) flag,count(*) from @table
    group by name
    having count(*)>1
    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

  • HI All... am new to SAP BPC module can any one help with Basic documentation.!

    Hi,
    Currently am working on SAP FICO module, now am interest to learn BPC10 module  (Netware/microsoft).
    Help me on overview of BPC 10.
    Thanks,
    Sreenu

    Hi Vasu,
    Kindly refer BPC 410, 420,430,440 you will get base of BPC.
    Also refer the following links.
    Planning and Consolidation - Enterprise Performance Management - SCN Wiki
    Getting Started - SAP Business Planning and Consolidation, version for SAP NetWeaver - SAP Library
    Its hard to get separate documentation only for functional area.
    Shrikant

  • HT204053 i got this massege on my iphone the maximum number of free accounts have been activated on this iphone can any one help?

    i got this massege on my iphone the maximum number of free accounts have been activated on this iphone can any one help?

    This restriction has no relation to creating free accounts, it means you may not sign in to another free account, on that iDevice because the serial number of the device (on apple's server) has their limit of free accounts associated to it. the only way around this is to use one of the three free accounts on the device which the server has associated, OR have apple reset the account/remove the restriction for that serial number...This has been posted in dozens of discussions, but they continue to ingnore the problem, what's worse is the telephone support is RUDE about it if you inquire.

  • HT1338 I have a macbook Pro i7 mid november 2010. I am wondering if i can exchange my notebook with the latest one. Can anyone help me out with this query please.

    I have a macbook Pro i7 mid november 2010. I am wondering if i can exchange my notebook with the latest one. Can anyone help me out with this query please.

    You can sell your existing computer using eBay, Craigslist or the venue of your choice. You could then use the proceeds to purchase a new computer.

Maybe you are looking for

  • Need info on mount, nomount

    hi i want to know difference wht is mount, nomount,open,close regards TJ

  • Updating content sent to Excel / PDF output

    Hi How do I change the data that is sent to Excel / PDF during the export command? I have JavaScript, which runs once the page is loaded, which updates values in the display to show the correct values, but these corrected values are not included in t

  • Error in Timer Event.

    Hi.           I'm using WLI 9.2.1 and I need to start a process through a timer event, i.e. at a given time with no need for any special message.           I've set up a timer event using "/WorklistEvent", the only one available, and it's message typ

  • Grey snowflake pattern with apple logo on display?

    Am getting a gray snowflake pattern on display screen (using older Mac pro). Did something fail in computer or is this a hacking job? Right now I'm using another MAC to send this.

  • How to get alternate path to download itunes

    can't update itunes...how do i get to an alternate path