multiple sql-joins

Results 1 to 3 of 3

Thread: multiple sql-joins

  1. #1
    Join Date
    Dec 1969

    Default multiple sql-joins

    how can I first join two tables, and then make a union join... like this:<BR><BR>select p.field1 AS field1, p.field2 AS field2, s.field1 AS field3<BR>from p, s<BR>where p.field 1 = s.field1<BR><BR>UNION <BR>select select asdf.field1 AS field1, asdf.field2 AS field2, s.field1 AS field3 <BR>from asdf, s<BR>where p.field 1 = s.field1<BR><BR>The querys work one by one but when I do the union I get errors. Isn&#039;t it possible to have both a regular join and a union join? please help!

  2. #2
    Medieval Dude Guest

    Default RE: multiple sql-joins

    In yer second SELECT statement, you have <BR>WHERE p.field1 = s.field1, but you don&#039;t have table p. You have table asdf.

  3. #3
    Join Date
    Dec 1969

    Default RE: multiple sql-joins

    There should be any problem doing a union as long as the number of columns are the same and that the corresponding types are comparable. What errors are you getting?<BR><BR><BR>OT:<BR>A union join is something completly different than a union.

Posting Permissions

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