🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #10969

Re: Pre-compile error problem

#10969
From: Wayne Niddery [TeamB]
Date: Wed, 01 Jan 2003 19:50
32 lines
2140 bytes
"The DeerBear" <rainaple@tin.it> wrote in message
news:3e132369@newsgroups.borland.com...
>
> First of all, Hi and happy new year.

Happy New Year to you too!

> I have a user, and I need to retrieve the list of users( with their
roles )
> in the system.
> What I want to do is to retrieve ALL the users in the system - excepted
for
> the one
> requesting the list - coupled with their roles.

You had the join just fine, but were making the Where clause far more
complex than necessary.

 select acc.user_id, acc.title, acc.first_name,
   acc.last_name, acc.user_id, r.user_role
 from ACCOUNTS acc
 INNER JOIN ROLES r on r.user_id = acc.user_id
 where acc.user_id <> :user_id

Supply the user_id to be excluded for the parameter in the Where clause.

You can add an Order By if you want.

--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
"Democracy, without that guarantee of liberty, is merely a method of
selecting tyrants." - Alan Nitikman
Technical Details
Message-ID: <3e134722$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!gatel-ffm!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3e125625$1@newsgroups.borland.com> <3e132284$1@newsgroups.borland.com> <3e132369@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a0e,5649031f8df85db4
X-Google-Attributes: gid114a0e,public
X-Google-ArrivalTime: 2003-01-01 12:10:03 PST
From: "Wayne Niddery [TeamB]" <wniddery@chaff.aci.on.ca>
Newsgroups: borland.public.interbase.sql
References: <3e125625$1@newsgroups.borland.com> <3e132284$1@newsgroups.borland.com> <3e132369@newsgroups.borland.com>
Subject: Re: Pre-compile error problem
Date: Wed, 1 Jan 2003 14:50:21 -0500
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 209.50.82.158
Message-ID: <3e134722$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1041450786 209.50.82.158 (1 Jan 2003 11:53:06 -0800)
X-Authenticated-User: wniddery
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!gatel-ffm!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail