#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    22
    Rep Power
    0

    IS it possible to combine two queies to one.


    Hi There!


    I have 2 queries

    SELECT Distinct(parent_ID) FROM item_audits WHERE created>=date OR edited>=date

    SELECT Distinct(parent_ID) FROM item_responses WHERE created>=date

    Now i want to combine the above 2 queries to one query.is it possible?

    NOTE: all the refered fields are of datetime type

    Regards
    Bosky
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    Paris Uppland
    Posts
    2,375
    Rep Power
    391
    Code:
    SELECT parent_ID 
    FROM item_audits 
    WHERE created>=date 
    OR edited>=date
    union
    SELECT parent_ID 
    FROM item_responses 
    WHERE created>=date
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    22
    Rep Power
    0

    Thanks


    Hey thank you so much. The statement fetches the exact result. The way i want it

IMN logo majestic logo threadwatch logo seochat tools logo