X-Original-To: pgsql-sql@postgresql.org Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 5DAD8475921 for ; Fri, 14 Mar 2003 02:57:04 -0500 (EST) Received: from klaster.net (pq24.krakow.cvx.ppp.tpnet.pl [213.76.41.24]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 2BAC42BDE5; Fri, 14 Mar 2003 08:53:36 +0100 (CET) Message-ID: <3E718B2F.6020700@klaster.net> Date: Fri, 14 Mar 2003 08:56:31 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Bruce Young Cc: pgsql-sql@postgresql.org Subject: Re: displaying correct name References: <20030314031128.15799.qmail@web10411.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200303/356 X-Sequence-Number: 12395 Bruce Young wrote: > what i want to do is select from "requests" where ownerid=. > 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