SQL query...any one?
Posted: Thu Feb 23, 2006 3:34 am
Hi Guys,
I'm having some problems figuring out how to construct a sql query doing the following:
Tables: Company, Contact.
"SELECT all companies AND match the corresponding Contact.
But a company might also not have a contact but should still
be returned."
This is what I have at the moment, but as you can see it wont return companies without a contact:
Cheers
Mikael
I'm having some problems figuring out how to construct a sql query doing the following:
Tables: Company, Contact.
"SELECT all companies AND match the corresponding Contact.
But a company might also not have a contact but should still
be returned."
This is what I have at the moment, but as you can see it wont return companies without a contact:
Code: Select all
SELECT company.name.....ect FROM company,contact WHERE company.name = contact.company AND company.phone LIKE '.$search_string;Cheers
Mikael