John,

This is totally ghetto, but it might work:


<cfquery name="qOld" datasource="...">
        SELECT *
        FROM PlatMemOld
</cfquery>


<cfquery name="qNew" datasource="...">
        SELECT *
        FROM PlatMemNew
        WHERE
                <!--- Only get records that are ALSO in old. --->
                id IN ( #ValueList( qOld.id )# )
                
        AND
                1 = 0
                
                <!--- Now, only get rows that do not match. --->
                <cfloop query="qOld">
                        
                        OR
                        (
                                        id = #qOld.id#
                                AND
                                        LastName != '#qOld.LastName#'
                
                        )
                        
                </cfloop>
</cfquery>


This gets all the OLD rows. Then, it gets all new rows that have a
matching ID AND have a mismatched last name. 

......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: John Eubanks [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 18, 2007 10:56 AM
To: CF-Newbie
Subject: Re: Query Question

Michael,

Many thanks.  Tried it and it didn't work.  The Primary key is just a
field called Id.  However, there are a different amount of records in
each table. One has a little over 700, the other has somewhere around
1400.

In a nutshell, this is what I am doing:  I have two tables with last
name, first name, and Id.  Only one table has a RegId (basically, just a
country identifier, because the other table doesn't need it right now).

I just need to compare the records, based on last name, and spit out the
ones that don't match.  The AND in the WHERE clause is just being used
for the RegId so that it just searches the names based on the country
(for example, U.S.).  You would think it would be pretty easy and
straightforward.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2442
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to