URGENT - Help in mySql query
| From: | Manisha | Date: | Thu, 18 Oct 2001 02:28:53 +0000 |
| Subject: | URGENT - Help in mySql query | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-71434@lists.php.net to get a copy of this message | ||
hi,
I want to write one query. I have 2 tables one as a master and another as detail.
1) newsletter - master table - ID and title is stored
2) newsletterArticle - details table - artID, refID (ref of master table) and body text is stored.
I want to display the newsletter only if I found corresponding record in newsletterArticle.
i.e if in newsletter there is an entry for ID 1, but no article in newsletterArticle, then I do not want to display that record.
This I want to achieve in single query. Something like below
select ID from newsletter where (select count(*) from newsletterArticle where refID = the ID of newsletter ???? > 0)
Platform - PHP / mySql /BSDi
Any help ? It is very urgent
manisha