Thread: Subquery help

    #1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    618
    Rep Power
    16

    Subquery help


    Code:
    SELECT DISTINCT deck, deny,`type`
    FROM cards
    WHERE `type` = 'scene'
    AND worth =1
    AND (
    `deny` =0
    OR deck = (
    SELECT set1
    FROM game_freebies
    WHERE `date` = '2008-11-15' )
    )
    The above sql code is what i'm using. If i run the subquery on its own it gets the correct data (set1 = moonhealing) but the set1 deck doesn't appear in the whole thing.

    Hopefully someone can point out why. I've rewritten this query several times but always the same problem

    Edit: Worked out why now

    Comments on this post

    • pabloj disagrees : Either post the solution or leave the thread open
    Last edited by Desbrina; November 9th, 2008 at 12:57 PM.

IMN logo majestic logo threadwatch logo seochat tools logo