From: Tomasz Myrta <jasiek@klaster.net>
To: Bruce Young <hbrucey@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: displaying correct name
Date: Fri, 14 Mar 2003 08:56:31 +0100
Message-ID: <3E718B2F.6020700@klaster.net> (raw)
References: <20030314031128.15799.qmail@web10411.mail.yahoo.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jasiek@klaster.net, hbrucey@yahoo.com
Subject: Re: displaying correct name
In-Reply-To: <3E718B2F.6020700@klaster.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox