Re: Problem with a Select Query

2004-05-06 Thread SGreen
Hi, I have a problem with a SELECT query. I have a users table and each user can be a Rep, Nurse or Administrator defined by User_Type. Each Rep has two Nurses allocated to them and the User_ID of the nurse is held in column Rep_Nurse_1 and Rep_Nurse_2. I am trying to perform a query that return

Re: Problem with a Select Query

2004-05-06 Thread Daniel Clark
SELECT user_id, rep_nurse_1, rep_nurse_2 FROM Users WHERE User_ID = 'x' > I have a problem with a SELECT query. I have a users table and each user > can > be a Rep, Nurse or Administrator defined by User_Type. Each Rep has two > Nurses allocated to them and the User_ID of the nurse is held in col

Re: Problem with a Select

2001-12-07 Thread Dibo Chen
Jens Vonderheide wrote: > > > Message From To > > > > Exampel 1 2 > > > > UserID UserName > >1 Me > >2 You > > > > Message From To > > ExampelMe You > > SELECT > u.Message, u1.UserName AS From, u2.UserName AS To > FROM > Messages AS m, >

RE: Problem with a Select

2001-12-07 Thread Fernando Andrés Cosa
Can you show me your complete SQL sentence? I thing you have to use two Users tables. Andres. - Original Message - From: Jonas Jonsson <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 07, 2001 12:02 PM Subject: Problem with a Select Hi I have a table named Messages

Re: Problem with a Select

2001-12-07 Thread Jens Vonderheide
> Message From To > > Exampel 1 2 > > UserID UserName >1 Me >2 You > > Message From To > ExampelMe You SELECT u.Message, u1.UserName AS From, u2.UserName AS To FROM Messages AS m, UsersAS u1, UsersAS u2 WHERE m.From = u

Re: Problem with a Select

2001-12-07 Thread Dibo Chen
select t1.name, t2.name from messages left join Users as t1 on mesagges.From = t1.UserID left join Users as t2 on messages.To = t2.UserID; Jonas Jonsson wrote: > > Hi > > I have a table named Messages > It looks like this > > Message From To > > Exampel 1 2 > > And I also