It will probably make no difference but to my way of thinking the join should be

LEFT OUTER JOIN region_tree
ON              region_tree.treeUUID = tree.treeUUID

Brett
B)


Mark Stanton wrote:
Hey All

Been beating my head against this one for a while now..... I've got two queries that work and a third (which is the one I am really after) that doesn't.


--- Query 1 - get trees & their species - works fine ---
SELECT tree.treeUUID, tree.treeName,
species.speciesDesc

FROM tree, species


WHERE species.speciesUUID = tree.speciesUUID



--- Query 2 - get trees & their regions (if defined) - works fine ---
SELECT tree.treeUUID, tree.treeName,
region_tree.regionUUID

FROM tree


LEFT OUTER JOIN region_tree
ON              tree.treeUUID = region_tree.treeUUID

GROUP BY tree.treeUUID, tree.treeName, region_tree.regionUUID



--- Query 3 - combination of the above - broken ---
SELECT tree.treeUUID, tree.treeName,
region_tree.regionUUID,
species.speciesDesc

FROM tree, species


LEFT OUTER JOIN region_tree
ON              tree.treeUUID = region_tree.treeUUID

WHERE species.speciesUUID = tree.speciesUUID

GROUP BY tree.treeUUID, tree.treeName,
region_tree.regionUUID,
species.speciesDesc



The error I get is: Server: Msg 107, Level 16, State 3, Line 1 The column prefix 'tree' does not match with a table name or alias name used in the query.

Any ideas?


Cheers


Mark


------------------
Mark Stanton Technical Director Gruden Pty Ltd Tel: 9956 6388
Mob: 0410 458 201 Fax: 9956 8433 http://www.gruden.com



--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004



--
Brett Payne-Rhodes
Eaglehawk Computing
t: +61 (0)8 9371-0471
f: +61 (0)8 9371-0470
m: +61 (0)414 371 047
e: [EMAIL PROTECTED]
w: www.ehc.net.au



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to