SQL question...

Results 1 to 2 of 2

Thread: SQL question...

  1. #1
    Join Date
    Dec 1969

    Default SQL question...

    i have two tables and i want to select all the records from one where soemthing=something but i want to get the coresponding record from the other table, the problem is the second table does not have a record for each record in the first table, i tried a join but it only shows records where both tables have an entry, not when there is stuff i the first tabel and not in the second. I know this is not to complex but i cna&#039;t remeber how to do it and i have no books with me to look at.<BR><BR>thanks<BR><BR>shaun..

  2. #2
    Join Date
    Dec 1969

    Default OUTER JOIN

    You need to learn how to build an OUTER JOIN.<BR><BR>SELECT xxx, yyy, ...<BR>FROM table1 LEFT JOIN table2 ON table2.id = table1.id<BR><BR>(or LEFT OUTER JOIN, but LEFT JOIN is enough)<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts