D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

RE: [LUG] FW: MySQL Query problems



owner-list@xxxxxxxxxxxx wrote:
You need an outer join.

Eg.

SELECT pinksheet.requirment,contact.phone,contact.fax FROM contact
LEFT JOIN pinksheet ON contact.PKey = pinksheet.contactid


That works perfectly, thanks! It seems to require a lot of horsepower
however but this should improve when I add some more where clauses in
to restrict the data set a bit.

Possibly, however I would consider looking at indexing contact.PKey and
pinksheet.contactid.  If those fields are not indexed, then the query is
going to be slow.

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.



Lynx friendly