in reply to joining two tables in mysql
You want the SQL JOIN command, which does just what your code does, except in SQL, and returns the joined results.
select * from voice_calls left join customers on customers.customer_id = voice_calls.customer_id
The statement doesn't return any calls for which no customer was found, so make sure you have proper constraints on your voice_calls table, so that every call has a valid customer_id enforced.
I'm not really sure where your question touches Perl though - a Google search for SQL JOIN directly brings up relevant pages.
|
|---|