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
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 o
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
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,
>
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 na
> 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
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
Hi
I have a table named Messages
It looks like this
Message From To
Exampel 1 2
And I also have a table named Users, A short version of it looks like this
UserID UserName
1 Me
2 You
Now to the problem
I want to do a Select from Messages like this