hello all:

i am using mySQL and I created a few tables and I am learning how I can use the SQL query on multiple tables. The following are the results which are quite confusing and it will be helpful if someone can help me understand as to how this works. Thanks!

select distinct names.contact_id,firstname,lastname,email,telephonework,telephonehome from names,email,telephones where names.contact_id=email.contact_id=telephones.contact_id;

the query results in the correct result that I was looking for.

But minor changes in the query above as follows leads to wrong results.

select distinct names.contact_id, firstname,lastname,email,telephonework,telephonehome from names,email,telephones where names.contact_id,telephones.contact_id=email.contact_id;

and

select distinct names.contact_id,firstname,lastname,email,telephonework,telephonehome from email,telephones,names where email.contact_id=telephones.contact_id=names.contact_id;

if you can tell me why this differs.. it will be helpful. Thanks!