You're welcome, of course.
If I may, you might be well-advised to seek advice from someone who is really a good
database programmer as to whether you're better off with joins or subqueries on this.
Of course, if this is a small dataset, it might not matter. However, as someone who (now)
has to worry everyday about how much CPU the SQL server is using when we even have
a dozen clients at once on the website, it might be well worth your time to think about.
Here's a couple resources that seem to discuss this a little bit:
http://onlamp.com/lpt/a/5220
http://stackoverflow.com/questions/141278/subqueries-vs-joins
Of course, one says subqueries are faster, and the other says joins are ... so we obviously
need someone smarter 😉
I'm sure that there are a number of factors that might affect this ... your RDBMS and its
optimizer, the size of the tables involved, etc., etc. I'm very much a generalist; I don't even
know a real DBA 🙁