Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,960
    Thanks
    120
    Thanked 76 Times in 76 Posts

    What is that I don't see

    Code:
    select count(distinct (id_galery)) from galery_optional_inf
    
    select count(distinct(id_galery)) from galery_optional_inf
    where id in (77)
    
    select count(distinct(id_galery)) from galery_optional_inf
    where id not in (77)
    results respectively:
    3688
    66
    3643

    What is that I don't see. Numbers are not right ?

    EDIT: tested with = and <> intead of using in (), and I get same result. I mean 66 + 3643 <> 3688 !
    Last edited by BubikolRamios; 12-05-2011 at 12:33 PM.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,156
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    NULLs, maybe?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •