Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: SQL JOINs vs WHERE statements

by EdwardG (Vicar)
on Aug 19, 2003 at 17:31 UTC ( [id://284962]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    create table people (person_id integer not null primary key, surname v
    +archar(40) not null)
    
    ...
        FROM   people, town
        WHERE  people.person_id *= town.person_id
        AND    (town <> 'Washington' AND town IS NOT NULL)
    
  2. or download this
    surname                        town                                   
    +  
    ------------------------------ ---------------------------------------
    +- 
    ...
    Jones                          NULL
    Harry                          NULL
    Peanut                         Cairns
    
  3. or download this
        SELECT surname, town 
        FROM   people
        LEFT OUTER JOIN town 
            ON people.person_id = town.person_id
        WHERE (town <> 'Washington' AND town IS NOT NULL)
    
  4. or download this
    surname                                  town                         
    +            
    ---------------------------------------- -----------------------------
    +----------- 
    Smith                                    Bristol
    Peanut                                   Cairns
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://284962]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found