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

Chris W. Parker cparker at swatgear.com
Mon Oct 21 18:58:01 CDT 2002


> -----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 gethis...

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



More information about the thelist mailing list