I'm trying a Q of Q for the first time and I must be doing something wrong. Can somebody enlighten me? I have two databases, both with email addresses. I want to come up with a list of addresses from DB1 that are not in DB2.
Here's what I tried:
<cfquery name="addresses_phx"
datasource="email_phx"
dbtype="ODBC">
SELECT first_name, email
FROM email_addresses
</cfquery>
<cfquery name="addresses_ibs"
datasource="apps_copy"
dbtype="ODBC">
SELECT Email
FROM IBS_apps
</cfquery>
<cfquery name="queryofqueries"
dbType="query">
SELECT email
FROM addresses_phx, addresses_ibs
WHERE addresses_phx.email NOT IN addresses_ibs.email
</cfquery>
<cfoutput query="queryofqueries">
#addresses_phx.email#
</cfoutput>
Here's what I tried:
<cfquery name="addresses_phx"
datasource="email_phx"
dbtype="ODBC">
SELECT first_name, email
FROM email_addresses
</cfquery>
<cfquery name="addresses_ibs"
datasource="apps_copy"
dbtype="ODBC">
SELECT Email
FROM IBS_apps
</cfquery>
<cfquery name="queryofqueries"
dbType="query">
SELECT email
FROM addresses_phx, addresses_ibs
WHERE addresses_phx.email NOT IN addresses_ibs.email
</cfquery>
<cfoutput query="queryofqueries">
#addresses_phx.email#
</cfoutput>