MySQL Forums
Forum List  »  MySQL Query Browser

Re: Left Join
Posted by: Jay Pipes
Date: September 26, 2005 12:25PM

Because MySQL is not MS Access.

No [ ] around the table name.
Get rid of all the Access-inserted parentheses.
Don't use keywords as table names.
Using DISTINCT with tableA.*, tableB.* is pointless. Specify column names.

Your query written properly:

SELECT DISTINCT m.*, d.*
FROM DepartmentWorkstations d
LEFT JOIN `month` m
ON d.chg_type = m.ChargeType
AND d.item_code = m.ItemCode
AND d.schedule = m.ScheduleCode
WHERE d.chg_type != 'p';

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Written By
Posted
September 26, 2005 12:08PM
Re: Left Join
September 26, 2005 12:25PM
September 26, 2005 02:42PM
September 26, 2005 02:49PM
September 27, 2005 06:55AM
September 28, 2005 01:20AM
September 28, 2005 10:19AM
October 02, 2005 10:53PM
October 01, 2005 04:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.