in reply to perl dbi select question

What fields in a record in TableA need to exist in a record in TableB to constitute identify? you can do the test in your SQL by (for example):
my $sth = "select count * from tableA where tableA.key1 = tableB.key2" +;

Obviously this is not the full query, as TableB is not defined.

Replies are listed 'Best First'.
Re^2: perl dbi select question
by baxy77bax (Deacon) on May 12, 2008 at 12:58 UTC
    ok

    let say that tableA has 2 columns x and y and let say that data in column y is corresponds to data in tableB (only one column z). now what i want to do is to pick every data in column x that has data y in tableB column z. and if it does than print it to a file.

    printing is not the problem, the problem is to check it for every record and then evaluate it to truth, so if it is truth than do something with it but if it is not skip it.

    thanx

      ok, so you need a full join:

      SELECT DISTINCT tableA.x FROM tableA,tableB WHERE tableA.y=tableB.z

      Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.