Please could you help me with a query?

Please could someone help with the following query? I have 3 tables:
Books
BookCode........Name
1.....................          Book1
2.....................          Book2
3.....................          Book3
4     .....................     Book4
5          .....................Book5
Categories
Catname.....................          BookCode
Sport          .....................1
Sport          .....................2     
Sport          .....................3
News          .....................2
News          .....................3
News          .....................4
NonFict          .....................2
NonFict          .....................5
Modern          .....................1
Modern          .....................2
Modern          .....................5
Old          .....................3
Old          .....................4
Stock
CatName     .....................Stocked
Sport          .....................1          
News          .....................1
NonFict          .....................NULL
Modern          .....................NULL
Old          .....................1
I need a query that selects all books.name where ALL of the book's related category names have stock records of NULL. So if the book is in 3 categories, all those categories need to be NULL in the stock table for a value to be returned.
Thanks very much.

And here's another way using a set operator:
SQL> select b.name
  2        ,count(*) cat_total
  3  from   books b
  4        ,categories c
  5        ,stock s
  6  where  b.bookcode = c.bookcode
  7  and    c.catname  = s.catname
  8  group  by b.name
  9  intersect
10  select b.name
11        ,count(*) cat_total
12  from   books b
13        ,categories c
14        ,stock s
15  where  b.bookcode = c.bookcode
16  and    c.catname  = s.catname
17  and    s.stocked is null
18  group  by b.name
19  ;
NAME             CAT_TOTAL
Book5                    2

Similar Messages

  • Hi, I'm trying to download applications, but after I enter my ID password it's giving me window - cannot open iTunes? Please could you help me with the solution

    Hi, I'm trying to download applications, but after I enter my ID password it's giving me window - cannot open iTunes? Please could you help me with the solution

    What did you have to do? I am having the same window come up and I read all of the support trouble shooting. Still won't work.
    I need help please.

  • Please could you help my iphone 5 is stuck while in recovery mode, there is a USB sign and an arrow is pointing to itunes symbol, with the Itune red logo symbol

    Please could you help my iphone 5 is stuck while in recovery mode, there is a USB sign and an arrow is pointing to itunes symbol, with the Itune red logo symbol

    Hi Turn iPhone off Connect lead to USB on your PC Press & hold power button down on iPhone  don't let go Connect lead to iPhone keep button pressed until PC sees iPhone then wait for restore . Cheers Brian

  • Hey sur. my name anas and am from morocco i've just got a new iMac 2011 with OSX 10.7 and i want to downgrade to 10.6 please could you help sur to solve this it

    hey sur. my name anas and am from morocco i've just got a new iMac 2011 with OSX 10.7 and i want to downgrade to 10.6 please could you help sur to solve this it

    anas guellaf wrote:
    it still make 3 bips before starting the IMAC.
    That is another problem not related to the Mac OS X version you are trying to use.
    Three beeps at startup means you have a bad ram module in the computer.  Did you install the ram or did it come from another owner this way?  The first problem you need to solve is the bad ram.
    When the iMac starts, go to the apple left side of the menu bar, About This Mac, More Info, System Report, Hardware, Memory and see what the report is on the memory...does the iMac report all memory modules that have been installed as OK or does it show bad memory?  If there is not any information, you then need to remove the memory modules and restart one at a time to see which is bad.
    On the bottom of the screen there should be a small door that you can remove with a small screw driver.  You need to lay the iMac flat, disconnect the power cord, remove that small door and remove the memory modules.  You can then put two in (if it has four) and see if it starts without the beeps.  Do that with each module so you find out which is bad.  Once you know the bad memory, you can buy a new module, just like the ones installed, so the iMac starts without the beeps.
    Next, you cannot use a DVD for another computer for your iMac unless it is from one that is identical to yours.  So, you need to talk to Apple and have them send the DVD for your particular iMac.

  • Please, could you help with The System Error?

    Hi guys,
    Please could someone help me with The system error: The Parameter is incorrect? which appears on the screen when I open Adobe Photoshop?
    It is Starter edition3.0 and so far it worked ok and suddenly this message haunts my screen. If I clic OK, whole application disappears. I tried hundred times and checked it is 5.1.2600 and my notebook has got Windows XP Profesional.
    Any advice hunging around?
    ThaaankxJ

    Thank you mark, I'll try.
    J
    Date: Fri, 18 Mar 2011 17:17:20 -0600
    From: [email protected]
    To: [email protected]
    Subject: Please, could you help with The System Error?
    Hi orion,
    Sorry that was the impression made by the support agent. If the version of the software that you have is 3.0 or 3.2, then the catalog can be upgraded when you run the trial version of Photoshop Elements. Version 8 had no time limitations, not sure if version 9 will timeout after 30 days or not.
    Just install, and when you launch, Elements will automatically convert the catalog to a format that it can read.
    -Mark
    >

  • My iPod has not been working for a month now and i was hoping that you could help me.The part where you charge and sync the iPod is not connecting.There is defiantly not the lead as we use it for the iPhone and that works please could you help!

    my iPod has not been working for a month now and i was hoping that you could help me.The part where you charge and sync the iPod is not connecting.There is defiantly not the lead as we use it for the iPhone and that works please could you help!
    yours sincerly
    jackfromsurrey

    What I am saying is ..........
    The iPhone HAS to be active making calls on the UK carrier network for the carrier to identify as "theirs" and therefore eligible for the Carrier to unlock
    The way to achieve this is to use a PAYG sim making and receiving calls to establish a customer relationship  with the Carrier and then follow the Carrier's process to unlock
    With a PAYG it usually means adding a specified (by the carrier ) amount  usually £15 /£20 depending on the carrier
    This is how O2 function and according to Gemma  this is how Vodafone work

  • I bought Adobe Acrobat Pro 9 and I need to reinstall it. Please could you provide me with a link. (I

    I bought Adobe Acrobat Pro 9 (in 2011)and I need to reinstall it. Please could you provide me with a link for download for MAC OSX. (I have the serial number in my adobe account.)

    Hi Rebmay ,
    You can download the trial version of Acrobat IX pro from the below mentioned link and activate it with the serial number.
    http://prodesigntools.com/all-adobe-cs5-direct-download-links.html
    Notes : Please follow these important instructions carefully or the link will not work!
    Thanks!
    Eshant

  • HT4623 i have updated my iphone to ios 6.0.1 but it is not activating so please could you help me out....while inserting in itunes it showing no sim card inserted

    i have updated my iphone to ios 6.0.1 but it is not activating so please could you help me out....while inserting in itunes it showing no sim card inserted

    All iPhones sold in Japan are carrier locked. The Japanese carriers do not offer unlocking.
    You can not use that phone on a carrier other than the one it is locked to.
    Sell it and buy one you can use.

  • My friend have problem in his system in macbook pro. after he update it. the macbook get restart every 10min. he so upset. please could you help him? thanks

    hello best stor in the world
    my friend have problem in his system in macbook pro. after he update it. the macbook get restart every 10min. he so upset. please could you help him?
    thanks

    thanks, but he wants this updeta.
    because has many specile features not found in the old update

  • Could you help me with an app situation? We purchased several codes for Splashtop to install on our iPad 2's. It was working great but now that we upgraded the OS they have disappeared. The codes that we purchased are giving us an error that they have alr

    Could you help me with an app situation? We purchased several codes for Splashtop to install on our iPad 2's. It was working great but now that we upgraded the OS they have disappeared. The codes that we purchased are giving us an error that they have already been used. So far it has only been 2 iPads. 
    Any solutions?

    The compiler is highlighting the areas you got wrong, although the error messages are somewhat confusing.
    Error 1: NSLog is a function and needs to be called as such, see e.g. the circleArea call on the line above. Functions are called using the function-name with its arguments in paratheses e.g. foo(12, 13).
    Error 2: looks like a typo, defining a function is done as function-name(... <arguments> ...) { ... <body> ...}. In your code there is a ";" between the arguments and the body that should not be there, you probably copy pasted it from the forward declaration at the top of the source codde file.

  • Ibooks for ipod 4g was deleted and new version of it was unable to sync. so please can you help me with that?

    On my apple ipod 4g (ios 6.1.6) ibooks was deleted and new version of it was unable to sync on my pod. Can please help me with that?

    Try going to the Purchased tab in the App Store app on your iPod and you should be able to redownload an older compatible version of the app from there - you won't be able to do it from your computer's iTunes, you can only download the current version of an app on there, it is only directly on a device that you can potentially redownload an older compatible version.

  • HT5622 Please an you help me with an identity query that I have using your 'rescue' services for an iPad?

    I have just helped set up an iPad for my elderly cousin who is in her mid 80s.  She cannot cope with multipile log in and passwords, so to help her out in case she loses her information, I have given my e-mail address for use as 'rescue' in case her information goes astray.  I have just had an e-mail in from you a couple of days ago asking me to verify if I had set up the 'rescue' services for myself etc.  The answer is no, but I would like to be able to use my address for my cousin's information - how can I make this work please?

    For info we are fellow users here on theseforums, you're not talking to iTunes Support nor Apple.
    The email should have a 'verify now' link in it e.g.
    If you click on that 'verify' link you should be taken to a browser and be prompted to sign into your cousin's account, abd doing that will verify the address as the rescue email address on your cousin's account. As it's only a rescue email address you don't have to use the verify link and verify it, it should still work as a rescue email address on her account (though you should probably verify it).

  • Unable to connect huawei E1731 mobile modem on my 2012 mac book air running lion 10.7.4....please could anyone help me with this?.....I am using an airtel 3g connection and am from india..

    I jus puchased an airtel 3g connection in india and the software that comes bundled with the huawei E1731 modem only supports upto snow leopard. I downloaded various drivers and installed them succesfully but the modem does not get detected. i am on lion 10.7.4 and a 2012 macbook air....how do i do this....please help...

    hi, i was facing this problem from past few days...solution... WE JUST HAVE TO USE A USB 2.0 HUB... this solved my problem....E1713 is not able to connect to usb 3.0 as it does with 2.0.

  • HT203167 Hi there. I downloaded an audiobook for the first time and I seriously can't find it anywhere!!! Please could you help

    Hi all.
    I decided to purchase Lee Evans Audiobook last night! I'm new to this kind of thing this was my first!
    The problem being is that I cannot find it anywhere, let alone listen to it!!!
    When I go in to ITunes and select the audiobook it states that it has been downloaded... Please help one confused incompetent person haha

    If you downloaded it on your iPad then have you checked to see whether it's in the Music app (iTunes on the iPad it just the store, it doesn't contain your downloaded nor synced content) ? When you have audiobooks on an iPad you will get an Audiobooks option under the More button at the bottom of the Music app.
    Note that audiobooks are currently a one-time only download from the store (so they won't appear in the Purchased tab in the iTunes store app for re-downloading), so you may want to copy it to your computer's iTunes via File > Devices > Transfer Purchases so that you can take a backup copy of it - it should copy over to the Books part of your computer's iTunes library.

  • HT1349 Hi please could you help me de authorise an old computer

    please help me de authorise an old computer

    Is this the kb you are referring to?
    http://support.apple.com/kb/HT1420

Maybe you are looking for

  • Buttons in dreamweaver

    Hello! I wonder if anyone could help me with my navigations buttons... I am trying to create buttons with images I have created with photoshop in a way that tthey behave like this: "up" stage with one image, the "over" stage with another image and I

  • Mac mini server refuses to get DHCP address from router

    Everything was going along fine. But after a power outage the server goes to a 169. address when the router puts out 198. addresses. If I put a static 198. address in it sees the network but won't connect to the internet. I've flashed the router (eve

  • Macbook Pro Doesn't Recognize Samsung TV

    Hi all, I've seen this question in a few other discussions which are still unresolved, but I'm hoping maybe I can get some answers. I've been hooking up my MBP 15" to my Samsung LCD TV (Model: LN32B460) for almost a year. Last night, I connected the

  • CS6 crashes on exporting to PDF

    When I try to export a document as a PDF, CS6 keeps crashing. I've got a few PDFs in the document and have tried deleting them completely to see if they were the reason for the crashing. However it still keeps crashing. This is really frustrating as

  • Planning for Sales orders for quantities greater than forecast in APO SNP

    Hi All, We have a requirement in which planning in SNP is done based on the forecast  quantity transferred from DP . Demand from Sales orders is not taken into consideration for planning . The PO's are created based on the forecast quantity only SO's