I would like to do a SELECT that would return all the fields in the
'Quotes' table plus the client info and plus the product info but
only if available. If product info is not available I would like to
get a result having all 'Quotes' info and 'Clients' info.

My query is:

SELECT * FROM `Quotes` LEFT JOIN (`Products`,`Clientes`)
  ON (`Products`.`QuoteID`=`Quotes`.`QuoteID`
  AND `Clientes`.`ClientID`=`Quotes`.`ClientID`)
  WHERE `Quotes`.`QuoteID`=6936


Try this:

SELECT * FROM `Quotes` LEFT OUTER JOIN `Products`
  ON (`Products`.`QuoteID`=`Quotes`.`QuoteID`)
  LEFT OUTER JOIN `Clientes` ON
  (`Clientes`.`ClientID`=`Quotes`.`ClientID`)
  WHERE `Quotes`.`QuoteID`=6936



Dundo



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to