MySQL Forums
Forum List  »  Newbie

Re: Combine 2 Select Distinct Queries
Posted by: Pham Huy
Date: March 28, 2017 10:17AM

SELECT * FROM StevesTable t
WHERE t.data1 = '%s'
AND t.data2 = to_date('%s','DD/MM/YYYY')
AND t.data1 in (select distinct data1 FROM anothertable ftt
join table1 tab on tab.somedata = ftt.somedata
where tab.somedata = 0
and tab.someotherdata = 1)
There, you check that all records in the first select have a data1 value in the second set.

Options: ReplyQuote


Subject
Written By
Posted
Re: Combine 2 Select Distinct Queries
March 28, 2017 10:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.