donmesserli
Programmer
I am trying to do two LEFT OUTER JOINs. I am using sqlite. The following code DOES NOT work (I get a syntax error)...
SELECT a.AutoID, a.Active FROM Automobiles AS a LEFT OUTER JOIN Units AS u ON a.UnitID = u.UnitID WHERE u.UnitNumber>='6' AND u.UnitNumber<'7' LEFT OUTER JOIN ParkingSpots AS p ON a.ParkingSpotID = p.SpotID ORDER BY Make , Model asc
If I remove the second LEFT OUTER JOIN, it WORKS (except for not getting all the data from the ParkingSpots table I need)...
SELECT a.AutoID, a.Active FROM Automobiles AS a LEFT OUTER JOIN Units AS u ON a.UnitID = u.UnitID WHERE u.UnitNumber>='6' AND u.UnitNumber<'7' ORDER BY Make , Model asc
If I remove the WHERE clause and leave in the second LEFT OUT JOINT, it WORKS (except for the fact that I get all of the Units)...
SELECT a.AutoID, a.Active FROM Automobiles AS a LEFT OUTER JOIN Units AS u ON a.UnitID = u.UnitID LEFT OUTER JOIN ParkingSpots AS p ON a.ParkingSpotID = p.SpotID ORDER BY Make , Model asc
Can anybody tell me what I'm doing wrong? Or is it a bug in SqLite?
Don Messerli
SELECT a.AutoID, a.Active FROM Automobiles AS a LEFT OUTER JOIN Units AS u ON a.UnitID = u.UnitID WHERE u.UnitNumber>='6' AND u.UnitNumber<'7' LEFT OUTER JOIN ParkingSpots AS p ON a.ParkingSpotID = p.SpotID ORDER BY Make , Model asc
If I remove the second LEFT OUTER JOIN, it WORKS (except for not getting all the data from the ParkingSpots table I need)...
SELECT a.AutoID, a.Active FROM Automobiles AS a LEFT OUTER JOIN Units AS u ON a.UnitID = u.UnitID WHERE u.UnitNumber>='6' AND u.UnitNumber<'7' ORDER BY Make , Model asc
If I remove the WHERE clause and leave in the second LEFT OUT JOINT, it WORKS (except for the fact that I get all of the Units)...
SELECT a.AutoID, a.Active FROM Automobiles AS a LEFT OUTER JOIN Units AS u ON a.UnitID = u.UnitID LEFT OUTER JOIN ParkingSpots AS p ON a.ParkingSpotID = p.SpotID ORDER BY Make , Model asc
Can anybody tell me what I'm doing wrong? Or is it a bug in SqLite?
Don Messerli