cool. -----Original Message----- From: Mark Leder [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 9:39 AM To: CF-Talk Subject: RE: SQL Union Statement
I got it fixed. This unique column advice did the trick. Thanks. Mark -----Original Message----- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 10:27 AM To: CF-Talk Subject: RE: SQL Union Statement yep, doesn't seem there is a need for the union? -----Original Message----- From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] Sent: 07 January 2003 15:25 To: CF-Talk Subject: RE: SQL Union Statement What happens when you run this query by itself: SELECT co_name, sponsor FROM pl_companies WHERE sponsor = 1 Does it return data? Is your data unique enough that you know the difference? You might try adding a column for type: SELECT co_name, sponsor, 'Cultivar Companies' AS co_type FROM tCultivarCompanies WHERE sponsor = 1 UNION SELECT co_name, sponsor, 'PL Companies' AS co_type FROM pl_companies WHERE sponsor = 1 ORDER BY co_name -----Original Message----- From: Mark Leder [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 9:18 AM To: CF-Talk Subject: SQL Union Statement Hi All, Am I using the UNION statement correctly to join two different queries based on two different tables in the same database? I can't seem to get the data from the pl_companies table to return a record. Thanks. ============================== <cfquery name="qSponsor1" datasource=#REQUEST.dsn1#> SELECT co_name, sponsor FROM tCultivarCompanies WHERE sponsor = 1 UNION SELECT co_name, sponsor FROM pl_companies WHERE sponsor = 1 ORDER BY co_name </cfquery> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

