Re: displaying correct name

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: Bruce Young <hbrucey(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: displaying correct name
Date: 2003-03-14 07:56:31
Message-ID: 3E718B2F.6020700@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bruce Young wrote:
<cut>
> what i want to do is select from "requests" where ownerid=<integer>.
> the result should contain the users.username of requests.buyerid and the
> item.title of requests.itemid.
> my problem is... i am getting the username of requests.ownerid instead from my
> query.
> here is my query:
>
> select u.username, i.title from test.requests r, test.users u, test.items i
> where r.ownerid=u.userid and r.itemid=i.itemid
> and r.ownerid = (select userid from test.users where userid=1);
>
> thanks.
> any help appreciated.
>
> - bruce
???
As you answered yourself in description above, change
r.ownerid=u.userid into r.buyerid=u.userid

Regards,
Tomasz Myrta

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message dev 2003-03-14 08:13:18 Re: Poor performance on a right join
Previous Message Larry Rosenman 2003-03-14 05:18:37 Re: nearest match