Received: from Kitten.mcs.com (Kitten.mcs.com [192.160.127.90]) by hub.org (8.8.8/8.7.5) with ESMTP id NAA23053 for ; Sun, 26 Jul 1998 13:49:11 -0400 (EDT) Received: from Venus.mcs.net (les@Venus.mcs.net [192.160.127.92]) by Kitten.mcs.com (8.8.7/8.8.2) with ESMTP id MAA26038; Sun, 26 Jul 1998 12:49:10 -0500 (CDT) Received: (from les@localhost) by Venus.mcs.net (8.8.7/8.8.2) id MAA23951; Sun, 26 Jul 1998 12:49:09 -0500 (CDT) From: Leslie Mikesell Message-Id: <199807261749.MAA23951@Venus.mcs.net> Subject: Re: [SQL] Select Query Help To: swalker@iac.net (Shawn T. Walker) Date: Sun, 26 Jul 1998 12:49:09 -0500 (CDT) Cc: pgsql-sql@postgreSQL.org In-Reply-To: <199807260146.UAA22966@proton.iac.net> from "Shawn T. Walker" at Jul 25, 98 08:46:12 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text According to Shawn T. Walker: > > Hello All, > > I am designing a database for a ISP call center. This is the > Select statment that I am trying to use to allow a employee search for > a user. It displays all of the information that I would like it to, > but if any of the items in the where clause are not found then that > item will not come up on the screen. Can anyone give me any > suggestions? > > Thanks in advance.... The mailing list has been great!!!! :) > > select myob.username,myob.lname,myob.fname,radius.ip_username,account_types.account_title,status.status_name > from myob,radius,account_types,status > where myob.username = radius.username AND radius.account_type = account_types.account_type AND radius.status = status.status > order by username; That's just the way SQL joins are supposed to work. If you want to also display non-matching elements in the same query you have to UNION with another select that gets them. In general, though, it is a bad idea to allow the tables to get out of sync with respect to records containing the key fields. Unfortunately PostgreSQL doen't have a way to enforce this internally so it is up to the client app. Les Mikesell les@mcs.com