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

Thread: i dont get it

  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation i dont get it

    would any one have any idea why this query would return a row that does not meet at least two of the requirements

    Code:
    SELECT 
    COUNT(*) AS cnt FROM 
    info AS a 
    INNER JOIN exp AS b 
    ON a.user_id=b.userId 
    WHERE 
    a.address_type='BT' 
    AND a.delete_me='N' 
    AND 
    (b.industry=29 AND b.industry_private='N') 
    AND 
    (b.title LIKE 'web%' AND b.title_private='N')
    the two that are red are the ones that dont match at all. in fact the user its pulling doesnt even have a row in the exp table.
    Last edited by guelphdad; 01-27-2007 at 04:27 AM. Reason: added [code] and [/code] tags

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You're selecting a count(*) so how do you know what IDs it's selecting?


  •  

    Posting Permissions

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