Hi,

Thanks for the reply.

An example of the record output I was after is...

ProjectID        ProjectOwner    ProjectManager
A12345             Bob Smith           John Smith

from tables:

User -
UserId    FullName
1            Bob Smith
2            John Smith

Project -
ProjectId    ProjectOwner   ProjectManager
A12345        1                        2

I have tried all sorts of joins and statements without much success... I can
obtain one name or both names if they are the same... but not different
names together in the one record.

Can you possibly provide an example of the specific joins you are talking
about. I think I must be missing something fundamental here.

Chrs,
Ash

----- Original Message -----
From: "DL Neil" <[EMAIL PROTECTED]>
To: "asherh" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, February 27, 2002 9:12 AM
Subject: Re: Query Problem...


> Hi Ash,
>
> > I am using MySQL 3.22.32 and are trying to accomplish the following
(without
> > going into too much detail, this is an example of the exact
situation)...
> >
> > 1) I have two tables:
> >
> >  a) User table containing: UserID, FullName
> >  b) Project table containing: ProjectID, ProjectManagerID and
ProjectOwnerID
> >
> >  ProjectManagerID and ProjectOwnerID are effectively UserIDs from the
User
> > table.
> >
> > 2) When I pull a particular record from the database by ProjectID, for
> > readability purposes, I would like the accompanying ProjectManagerID and
> > ProjectOwnerID to
> > be displayed as a name, not an ID (for example: John Smith, not A12930).
> >
> > Has anyone got any ideas how I can select (within one record) both names
> > from the User table by each respective UserID (represented by the
> > ProjectManagerID and the ProjectOwnerID)??
>
>
> This is quite logical (when you look back at it!). Set up two joins from
Project to User, the first equating
> ProjectManagerID to UserID and the second ProjectOwnerID to UserID - just
because User is only one table,
> doesn't mean you can't have multiple ways of joining to it!
>
> If that's not it, please send the query you have so far.
>
> Regards,
> =dn
>
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to