Try to understand how the AND and OR keywords works

I read that the priority of the use of AND and OR in which the clause can be determined by where you put the parenthesis. I tested it and it's true. How is it...

THIS...
 SELECT invoice_number, invoice_date, invoice_total
FROM invoices
WHERE (invoice_date > '01-MAY-2008' OR invoice_total > 500)
AND invoice_total - payment_total - credit_total > 0
Order By Invoice_Number; 
AND THIS...
SELECT invoice_number, invoice_date, invoice_total
From Invoices
WHERE invoice_date > '01-MAY-2008' OR invoice_total > 500
And Invoice_Total - Payment_Total - Credit_Total > 0
ORDER BY invoice_number;
GIVE ME DIFFERENT RESULTS, BUT THIS...
Select distinct (Select Count(Invoices.Vendor_Id) From Invoices Where Invoices.Invoice_Date < '01-MAY-2008')  as Test_Column
From Invoices 
Where (Invoice_Date > '01-MAY-2008' Or Invoice_Total > 500)
And Invoice_Total - Payment_Total - Credit_Total > 0;
AND THIS...
Select distinct (Select Count(Invoices.Vendor_Id) From Invoices Where Invoices.Invoice_Date < '01-MAY-2008')  as Test_Column
From Invoices 
Where Invoice_Date > '01-MAY-2008' Or Invoice_Total > 500
And Invoice_Total - Payment_Total - Credit_Total > 0;
DO NOT GIVE ME DIFFERENT RESULTS.

Published by: mookjais on February 24, 2011 20:43
select distinct (select count(1) from A ...)   from   

you get the distinct value of the counts, then there could be double account as number 23 for example.

select count(1) from A .......
--------
23
40
23
23
....

Tags: Database

Similar Questions

  • I have trouble understanding how the calendar for the vi simulate Signal Express. Can anyone help?

    I'm generating a signal to 100,000 samples per second. The frequency is 4 Hz. I then pass the signal through the basic vi trigger detection to find out where the wave crosses 0.5.

    Since the signal is 4 Hz, the waveform should cross 0.5 each 0.25 sec. However, when I created a table of the times that the trigger is activated, it is not 0.25 seconds.

    I don't know if there is a problem with my calculation of the duration of simulation, or if I don't understand how the vi signal simulation works. Thank you very much for your ideas!

    Yes, you made a few mistakes or bad assumptions about who express vi.

    The frequency is 4 Hz samples per second is of 100,000 samples (orders of magnatude) generated too high are 76 (0.76mSecs worth of data).  1% duty cycle so a transition product only once every thousand loops! 1315 or 1316 loops between L - H transition to be more precise

    Try

    40 s/s

    40Samples (a seconds of data)

    right to 50%

  • Impossible to download the track of Photoshop CC.it says try again! However, the retry option is not working.any suggestion?

    Impossible to download the track of Photoshop CC.it says try again! However, the retry option is not working.any suggestion?

    Urban Baul for more information on how to resolve errors download please see error downloading applications Cloud Creative - http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html.

  • Trying to understand how the Eloqua cookies work and relate to a user

    Greetings,

    I'll just start where I think my basic understanding is for the moment and move what I seek to clarify and accomplish.

    High level understanding:


    • The user hits your Web site that contains the "Eloqua traceability Code" in this topic.

    • Cookie is created that is grouped with ".". Eloqua.com.

    • The user goes to a form and submits their contact information OR surfed a bit before hitting a form

    • … At this point, I get a little misty... *.

    • Eloqua treats the presentation (or create a new record or at the e-mail address and adds the information as prescribed in the existing record)

    • (Will not enter treatment programs because they are not relevant to my question)

    • Eloqua is to the top of the confirmation page

    * So here's what I'm foggy on...

    1. How/where the cookie will be created. I followed to this 'image' tag in the elqImg.js file. (http://now.eloqua.com/visitor/v200/svrGP.aspx?pps=3 & siteid ={SITEIDHERE} & ref2 = elqNone & tzo = {TIMEZONECODE} & ms = 933 & elqCookie = 1). This is the only method of creation of the cookie, calling this URL?

    2. This GUID in the ELOQUA cookie, is the one that is now linked to the folder of the user once they succeeded to convert?

    The goal

    What I do, it is a construction of a method aside server to validate users return, those who have converted for example via a form and are known to me.

    I have an idea what happens to the code, I'm just here to chop the process on the side of Eloqua how it handles data as well as what look for it system to properly attach the USER = this cookie GUID (if that even happens).

    If it's worth whatever it is we're always on Eloqua 9 If this has an impact on the method.

    Any help is appreciated.

    Thank you kindly

    Hello Adam,.

    I'm not quite clear on the use cases that explained you at the end, but I'll explain how the creation of cookie:

    When you followed the scripts on your page - in this case, you have the old synchronous tracking scripts, the call to the function img.js below

    results in the creation of cookie. Please note that there is no code client which translates into the creation of cookie, but when this line of code above is executed, this triggers a call to our svrGP.aspx page - as you have already noticed, and exist on our server-side. This page performs certain functions among which is to create a GUID and drop a cookie on the browser if it isn't one already. This page is also responsible for the creation of a visitor profile, which is a record in our visitor table in the database that has a GUID primary key - which is what contains the Eloqua cookie.

    Thank you

    Tarek

  • To understand how users and groups in vCAC 6.0

    I would like to help you understand how to add users and groups.  How can I add normal users and user groups to vCac to consume the items in the catalog?  I don't want to do these users administrators, I want simply to connect and to be consumers of the resources that we have Setup using the plans.

    I see two places to add users:

    (1) after registration as an administrator of the tenant, under the "Administration > groups | The users tabs", but it won't let me add administrative roles to these users or groups.

    (2) by the business group section "users >" however I can't seem to add any AD groups, only users one at a time.

    Where am I supposed to add these user groups and permissions that they need to have to run virtual machines?

    Our scenario is very basic.  We do not currently want applications to go to an approver until the virtual machine is running, we would like 'requests VM' automatically be approved and immediately spun. VCac using 6.0.

    Thank you

    You don't need to add users to your tenant, if they are in the identity store (AD, LDAP, etc.).  You simply allow their service, the elements catalog and actions with rights... However, they must be a member of a BG for payments.

    There is currently a bug where groups of users do not appear when you type the names of groups in the research - but you can still enter the name of the user group, and this group will become a member of the Group of companies.

  • Clear on how the table of Index OpenG works with a 2D Arrray

    Hello

    I don't understand how to use the undex OpenG table with a table entry 2D. I joined the contest help window, said that aid

    "For 2D tables, connect the clues and indices 0 1 entries to specify the items you want.

    So what does really mean? I wired the vi as requested and the vi always puts a 1 d table. So are the lines of entries in table two indexes and columns or what?

    I am sure that you send in your line indices table and the table of the column indices and get out of your table 1 d of elements.

    (i.e. rank table [1,5,7] and table column [4,8,10] gives you a table 1 d elements (1,4), (5.8), (7.10))

  • Can someone help me understand how the URL handlers work and how they can be used to launch AppleScripts links?

    Preface:

    -I'm not a complete noob, but Applescript is my first programming language

    -J' have been able to write scripts that are useful for a variety of tasks, but especially the interaction between the Excel and numbers

    -I consider myself to be an advanced/expert with the numbers, but not Excel

    My goal is to be able to run scripts from a link in a Numbers spreadsheet without opening a browser.  For me, a key missing numbers is the ability to create interactive buttons.  I know reading is it possible to use links in OSX to trigger scripts via URL, but all managers the explanations and instructions, I found are over my head, because they reference the definitions of programming I don't understand.   I know it's probably a very long answer.  I really appreciate the effort and promise of will not be wasted your time and your knowledge will be used for good (at least by me).

    World  thanks,

    Ash

    Google this string: Manager of URLS AppleScript.

    The first strike several include the how-to code AppleScript which should guide you on the construction and launch of a URL handler.

  • I'm new to smart playlists and were able to implement simple. I can't understand how the rules to consolidate all my songs to cover of all my songs in a playlist.

    Smart playlist to group all covers of songs all the

    Are these songs marked somehow as blankets? For example, I add coverage to the tag group in Get Info. Then, it is trivial to create smart playlist with one or more rules.

  • I can't understand how to and dangle object

    When I change a layer name by adding 'swing' and create a point of origin and put them both in the same folder that I've seen a few videos, he is there no dangle effect happening and I can't understand it. What I am doing wrong? I'd like to help even though I know it's good basic thank you!

    For the part of the character you want to hang, create a group that contains the work for that part, and then create benchmarks for the 'origin' and one or several "Swing" locations that will be controlled by the behavior of Dangle. Then name the group with the prefix '+' (by example, "+ sheet") so that its contents can be offended regardless of his brothers.

    If you put "Swing" on behalf of the Group (for example, "+ leaf Dangle"), it will create an implicit Dangle handle in the center of the frame enclosing group, so you can or don't want according to the movement you want to produce.

    You can also use the tool Dangle in the Panel of the puppet to add handles Dangle and just set the structure (Group and its content, but no handles 'Swing') in Photoshop/Illustrator. In this way, you can experiment with Dangle handle character places.

    If you want to share your work, we can suggest how to set up for pending.

    We are also working on a new video tutorial for Dangle we will publish when you are ready.

    Thank you.

  • To understand how the situation report of the printer hp officejet 6000

    Product number CV051, Vista 32-bit.  Earlier today, a telephone support had run me uninstall3 and then reinstall (my printer print an alignment page after each print job).  The initial problem was solved, but now says my printer HP solutions Center is disconnected.  I can and have printed documents.  The printer is connected of course.  So I ran a Printer Status Report.  This report argues that the network status is offline, and Active connection type is none.  Is that what it means that the printer is not connected?  If so, how can I solve this problem?  (Although it is a newly installed printer this printer was purchased for more than a year and is no longer under warranty.  I used my support call a phone to solve the problem of alignment page).  Please note: I am really a Novice!

    susana1027

    Hey Susana,

    You are assuming that this network status 'offline' means that the printer is not connected to the network. Have you set up this printer on the wireless network again? Also how this printer currently connected to the printer (wired or wireless)? IM waiting for run the HP Print & Scan Doctor to see if he is able to solve your problem. If it does not solve the problem, post back with new details and will continue from there.

    Thank you!

    Sean

  • Can not understand how the adjacent color elements

    Hello, I am a new user of illustrator and it's been a frustrating experience.

    I just want something simple... the linework, color using the fill color or a clipping mask. However I can't find how to do.

    Whenever I tried to fill color or a clipping mask, he selects the wrong part of the object and does not follow the line. Please see the attached picture. Why is happening. Why Selection tool cut it like that?

    (you see I tried to color eggplant, but the purple part is all wrong...)

    I would be grateful if someone can help me.


    Also, I find that it is incredibly difficult to choose the color that I want to leave this little rectangular box on the right side. How can someone find the color they want in this tiny color box?

    Is there anyway I can have a color wheel, or is it more easy way to choose the color from the palette?


    Adobe 3.png

    Use the closed paths (more intuitive) or paint (smoke and mirrors).

    In this example, you must continue drawing the pink form (on the green form) with the pen until the path from the farm. Then go behind the Green shape by using the layers panel or cut and paste behind.

    Or you can create a live painting of this group and colour it with the Live paint bucket.

    I think you'll learn more by the way, with closed paths. Some people think of paint as cheating.

  • Help me understand how the scheduling TMS add participating really means.

    Hello

    I have a MSD working with the conductor and telepresence server.

    Can I create a reservation and incoming and outgoing calls to telepresence rooms without any problems.

    I n ' have local endpoint registered to my TMS so I add participant external tab, let's say I add 5 participants for H323 and SIP 5, so I have a meeting room with 10 reserved ports.

    During the call to the meeting instead that it will fall into these 10 port reservation, instead, he join as an adhoc appeal and now the meeting room extended to 11 participants with 1 connected and not connected 10.

    Why?

    Thanks in advance.

    NATT

    Seems to be a bug, CSCuv66300.

    Suggest you to contact your Account Manager and bring their to their attention so that they can raise this issue at the DRINK for you.  Clients more that draw attention to a particular request of the bug or development, the greater chance of it running.

  • need to understand how the dataguard works in a CCR environment

    We had a dba has just left, and I inherited the system now. I want to make sure that I followed the right information on the dataguard.

    Help please.

    Hello

    Read http://docs.oracle.com/cd/E11882_01/server.112/e25608/manage_ps.htm#i1005610

    Anand

  • Can someone help me understand how the code should look like this?

    I keep looking for forums and I can't figure out if I need an instance name, a frame name, convert to symbol, graphics or video clip. All that I want is the images I have to move and stop as this graph on this website. If anyone can help to provide the code, it would be greatly appreciated!

    Best,

    Brett

    http://byluisvenegas.com/zines/ey-magateen/ey-magateen-5/

    this.addEventListener (MouseEvent.MOUSE_OVER, stopF);

    this.addEventListener (MouseEvent.MOUSE_OUT, playF);

    function stopF(e:MouseEvent):void {}

    This.Stop ();

    }

    function playF(e:MouseEvent):void {}

    This.Play ();

    }

  • How the recovery disk creator actually works?

    I read on the forum on the recovery disk creator and I'm a bit confused... in the name, it becomes obvious that he is indeed a creator, but I have no thread caught my attention which in fact is to create a recovery disk. How does it work? Of course, it is used to restore the system to the default settings, but you can make your own backup copies recovery of the State, the system is now? Or do all the recovery discs take you where it all begun so to speak...

    And if I could create my own presets, restrictions on the amounts of images? And he brings with him all that is installed in the time that the image was created?

    As I made clear in my previous posts, I have not bought the thing... It's in the mail. I'm just getting ready for the terrible experience of how things can go wrong when I don't have the original DVD of Windows in my hands :)

    Thanks in advance!

    Hello

    So many questions! I'll try to help you with unclear words.

    In the latest Toshiba has delivered laptop computers equipped with recovery media. Very old computers laptop Toshiba created mainly two CD recovery and newer laptops a Recovery DVD.
    This recovery DVD was in the box with the notebook.

    This recovery CD/DVD contains a recovery image. Recovery image can be installed on the laptop and after that each installation of the laptop will have factory settings the same state that you have when you start your laptop for the first time.
    Recovery image contains the system operations, drivers, Toshiba and utility tools and some additional software. Therefore, after you install the recovery image, you should not install drivers or additional software. Everything is done for you.

    Then, new notebooks, as your Satellite Pro A300-1EA, are not delivered with a separate recovery media and all those who buy the laptop must / should create a clean copy. This copy can be used for installations of operating system further. For recovery, multimedia creation Toshiba has designed special tool and it is designed to create recovery media ONLY.

    To start the tool, select the media you want to use (I recommend DVD - R), put the media in the optical disc drive and click Create.

    In fact the recovery image is saved on the HARD drive and placed on the second partition in the file called HDDRecovery.
    Still, there is one thing. If nothing is changed on the system, partitions, and if this folder is not removed, you can install operating system whenever you want, but without using recovery media.

    It is simply procedure. When the laptop starts press F8 and you will enter the advanced startup options. The first is called to fix my computer. Enter it and follow the on-screen menu. After two stages, you will see the window with several options and the last recovery option.

    So please create DVD to be on the right side of recovery.

    If you have any other questions please ask. Someone here will help you for sure.

    Good luck!

Maybe you are looking for