Results 1 to 3 of 3
Feb 3, 2006, 13:55 #1
- Join Date
- Dec 2003
- Atlanta, GA
- 0 Post(s)
- 0 Thread(s)
[RESOLVED] Using a Field Multiple Times in One Statement?
I am working on a ticketing system and need to pull the same field from a table twice. In my ticket table there is a field that links to the creator's contact ID as well as the assigned person's contact ID. Basically, both of these link to the ID field in the contact table. Doing this connection is not the problem. I need to pull out <contact table>.name twice, once for each ID (creator, assigned). MySQL is pulling only one of the names, and is simply displaying it twice. A sample of what I have so far is below:Code:
SELECT B.name, B.name AS assignee FROM ticket A, contacts B LEFT JOIN B ON A.assigned_id=B.id WHERE A.creator_id=B.id
Last edited by erikwebb; Feb 3, 2006 at 14:32.