Why not put the names of the actual columns you want in your
SELECT clause, like:
SELECT owner.contact_fullname AS owner_contact_fullname,
....
Nick
-----Original Message-----
From: Colin Robinson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 11:23 AM
To: SQL
Subject: JOIN with correlation names
I have two tables
[tasks]
task_id
task_summary
task_owner_id (foreign key driver_id from [drivers])
task_assignee_id (foreign key driver_id from [drivers])
[contacts]
contact_id
contact_fullname
I want to write a query that joins the two tables and allows me to display
the full names of both owner and assignee for a task
SELECT *
FROM tasks
JOIN priorities ON priority_id = tasks.task_priority
JOIN contacts as owner ON owner.contact_id = tasks.task_owner_id
JOIN contacts as assignee ON assignee.contact_id = tasks.task_assignee
Why do I get an error when I try to output #owner.contact_fullname# ?
Cheers Colin.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists