Looks like you about have it.
I am not sure if what you have will work or not.  I would alias both tables
and save some typing like this:


SELECT R1.UID, R1.firstname, R1.lastname,
R1.email, R1.referrer, senders.firstname, senders.lastname,
senders.email
FROM recipients R1, recipients senders
WHERE senders.UID = R1.referrer

It will depend on your db, but it might get confused when you alias one
instance of the table and not the other one.

Troy

-----Original Message-----
From: Roland Dumas [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 12, 2004 2:29 PM
To: [EMAIL PROTECTED]
Subject: Re: Witango-Talk: Self-join problem




On 9/12/04 1:20 PM, "Roland Dumas" <[EMAIL PROTECTED]> wrote:

> 
> Ok, I came to the conclusion that you can't do a self join using the
search
> action. Have to do a direct dbms and create an alias of the table and then
> join it with the actual table.
> 
> As in 
> 
> SELECT recipients.UID, recipients.firstname, recipients.lastname,
> recipients.email, recipients.referrer, senders.firstname,
senders.lastname,
> senders.email
> FROM recipients, recipients as senders
> 
> 
> 
> - an SQL greenhorn -


Sorry, forgot to paste the important line:

SELECT recipients.UID, recipients.firstname, recipients.lastname,
recipients.email, recipients.referrer, senders.firstname, senders.lastname,
senders.email
FROM recipients, recipients as senders
WHERE senders.UID = recipients.referrer


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to