What you are trying to do in the first query is called a INNER JOIN, so the query would be something like:
select count(*) from tableA
INNER JOIN tableB ON (tableA.tableAkey = tableB.tableBkey)
Here's the skinny: when you want to get information from two or more tables, you do this by joining them, which is based on fields in the two tables (e.g. “table1key, table2key”, for example ... use any existing field-name(s) you have). For each unique value occurring (for an INNER join) in both tables, every occurrence of that value in one table will be associated with every occurrence of that value in the other, a so-called Cartesian product.
Conceptually, the “rest” of the actions requested by the query are then applied against the join-result.
In reply to Re: perl dbi select question
by Anonymous Monk
in thread perl dbi select question
by baxy77bax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |