[thelist] SQL: looking for resources, have one question

Chris W. Parker cparker at swatgear.com
Mon Oct 21 19:04:01 CDT 2002

(that first email was sent prematurely. here is the email as it should
have arrived.)

> -----Original Message-----
> From: Chris Blessing [mailto:webguy at mail.rit.edu]
> SELECT a.manufacturerID, a.ID
>   FROM products a
>     INNER JOIN manufacturers b
>     ON a.manufacturerID = b.id
>   ORDER BY a.manufacturerID

using this kind of query i've moved on to a more complicated request in
a different app. this time i want to pull back two names of an item
correlating to matching ID's.

what i've come up with so far is this...

SQL = "SELECT a.ppName " _
	& "FROM PossibleProducts a " _
		& "INNER JOIN productTracking b " _
		& "ON b.ptProduct = a.id " _
& "UNION " _
	& "SELECT c.paName "_
		& "FROM PossibleAdverts c " _
			& "INNER JOIN productTracking b " _
			& "ON b.ptReferralSource = c.id"

(pasted in directly from the script.)

this gives me a single column recordset with the output from both
query's in the single column. so basically i get this...

Column 1

instead of what i'm expecting to get...

  Column 1               |   Column 2
DataFromTheFirstSelect-1 | DataFromTheSecondSelect-1
DataFromTheFirstSelect-2 | DataFromTheSecondSelect-2
DataFromTheFirstSelect-3 | DataFromTheSecondSelect-3

what am i doing wrong and what is really happening contrary to what i'm
thinking should be happening?


More information about the thelist mailing list