Dear friend, I don't know if I've figured out what you want, but I've written a script for you. You can test it! Warning!!! I didn't test it, ok! So. It's the following. #!/usr/bin/perl use Pg; # In <DBNAME> you must change to your database name. $conn = Pg::connectdb("dbname=<DBNAME>"); open (YES, ">>/var/log/this_customer_are.log"); open (NO, ">>/var/log/this_customer_arent.log"); # In <TABLE> and <COLUMN> you must to change to first table and coluna of your database. # In <TABLE1> and <COLUMN1> you must to change to second table and coluna of your database. $result_first = $conn->exec("select * from <TABLE> order by <COLUMN>;"); $result_second = $conn->exec("select * from <TABLE1> order by <COLUMN1>;"); for($i=0;$i<$result_first->ntuples;$i++) { $customer_number_first = $result_first->getvalue($i, <COLUMN>); for($count=0;$count<$result_second->ntuples;$count++) { $customer_number_second = $result_first->getvalue($count, <COLUMN>); if ($customer_number_first == $customer_number_second) { $costumer_found = 1; } else { $costumer_found = 0; } } if ($costumer_found == 1) { print YES "$customer_number_first\n"; } elsif ($costumer_found == 0) { print NO "$customer_number_first\n"; } } close(YES); close(NO); Best regards,
Cleiton L. Siqueira Colégio Monjolo [EMAIL PROTECTED] (0xx45) 520-1915 Esta mensagem foi enviada pelo sistema MONJOLO WEBMAIL http://www.colegiomonjolo.com.br -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]