pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Select Query Help
2+ messages / 2 participants
[nested] [flat]

* Select Query Help
@ 1998-07-26 01:46  Shawn T. Walker <swalker@iac.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Shawn T. Walker @ 1998-07-26 01:46 UTC (permalink / raw)
  To: pgsql-sql

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;

-- 
                                                         
           Shawn T. Walker  swalker@iac.net              
              Internet Access Cincinnati                 
"Dogs believe they are human. Cats believe they are God."                                                          
  If your strength is small, don't carry heavy burdens.  
      If your words are worthless, don't give advice.    
 	          __Chinese Proverb                      
                                                         



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] Select Query Help
@ 1998-07-26 17:49  Leslie Mikesell <les@Mcs.Net>
  parent: Shawn T. Walker <swalker@iac.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Leslie Mikesell @ 1998-07-26 17:49 UTC (permalink / raw)
  To: swalker@iac.net; +Cc: pgsql-sql

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1998-07-26 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-07-26 01:46 Select Query Help Shawn T. Walker <swalker@iac.net>
1998-07-26 17:49 ` Leslie Mikesell <les@Mcs.Net>

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