Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxxAPC, How to unsubscrube from dategen spam, WWWXXXAPC, docmd.close 2585, WWWXXXDOCO, nu vot, dhcpd lease file "binding state", WWWXXXDOCO, how to setup procmail to process html2text, how to setup procmail html2text

Links

XODOX
Impressum

#1: Compare record in two tables, return fields that don"t match...

Posted on 2007-07-09 15:59:14 by Nick

Does anyone know if there is an easy way to compare a row from table
a, to a row in table b with the same structure/field names and return
those fields which don't match?

I have table_a storing the originally submitted applicant information,
and table_b storing a version that can be changed. When a user makes a
change I'd like to compare it to the original table to see what fields
were changed, preferably without opening the row from both tables and
going field by field in code to see if they match...

Thank you for the help!

Nick Smith
Application Developer
Influent Inc.

Report this message

#2: Re: Compare record in two tables, return fields that don"t match...

Posted on 2007-07-09 18:11:54 by Omar Langset

Nick wrote:
> Does anyone know if there is an easy way to compare a row from table
> a, to a row in table b with the same structure/field names and return
> those fields which don't match?
>
> I have table_a storing the originally submitted applicant information,
> and table_b storing a version that can be changed. When a user makes a
> change I'd like to compare it to the original table to see what fields
> were changed, preferably without opening the row from both tables and
> going field by field in code to see if they match...
>
> Thank you for the help!
>
> Nick Smith
> Application Developer
> Influent Inc.
>
This should work

select * from table_a a, table_b b where a.applicantId = b.applicantId
and ((a.row1 != b.row1) or (a.row2 != b.row2) or ..... )

Report this message