7 messages in com.mysql.lists.mysqlRE: SELECT from 3 tables - Need help
FromSent OnAttachments
Nuno Oliveira18 Jan 2007 03:44 
Davor Dundovic18 Jan 2007 04:02 
Nuno Vaz Oliveira18 Jan 2007 04:30 
Nuno Oliveira18 Jan 2007 04:38 
Chris Boget18 Jan 2007 05:15 
Nuno Vaz Oliveira18 Jan 2007 06:12 
Olexandr Melnyk18 Jan 2007 07:59 
Subject:RE: SELECT from 3 tables - Need help
From:Chris Boget (chri@wild.net)
Date:01/18/2007 05:15:35 AM
List:com.mysql.lists.mysql

Do you mean that I should replace SELECT * FROM with SELECT field1, [field2],[...] FROM?

Yes.

If so, I need to specify the table name like SELECT Clients.Name correct?

You only need to do that when 2 tables have the same column name. In general, though, it's good practice to always include the table name when joining multiple tables.

Also, how can I access to Quotes.QuoteID and Products.QuoteID?

Use aliases (which can be anything; I'm just replacing the '.' with a '_' below)

SELECT Quotes.QuoteID AS Quotes_QuoteID, Products.QuoteID AS Products_QuoteId FROM ...

Thnx, Chris