Sagewire Logo

Compare record in two tables, return fields that do not match...

2 Message(s) by 2 Author(s) originally posted in mysql database


From: Nick Date:   Monday, July 09, 2007
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 do not 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.


From: Omar Langset Date:   Monday, July 09, 2007
wrote in message:
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 do not 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 ..... )



Next Message: Simple MySQL Index


Blogs related to Compare record in two tables, return fields that do not match...

Top 30 Politics Quotations
5100 Dell Inspiron Moth Restaurant Furniture Bar Tables And Stools Registrar Iso9000 Alternative Bad Credit Loan Student Plug Ac Adapter Battery Axim Dell Step Cradle South Florida Auto Show Bed Cord Injury Sore Spinal ...

Orchestrating Attitude: Getting the Best from Yourself and Others
Jim and Jane Smith and their two children (Jonnie, age 3 and Janie, age 4) have just seated themselves at the table. Before the first bite of dinner is enjoyed, Jonnie spills his milk and it goes everywhere. ...

Simple and Easy Tips - How to Throw a Tailgate Party No One Will ...
Spinal Cord Injury Disease Credit Card Bad Credit Loan Free Credit Report Credit Repair Buy Sprint Cell Phones Without Plans Dell Computer Company Officers Dell Inspiron 600m Motherboard Problem Spanish Property Market ...

History of Soccer - An Essay
They took over their whole town including houses, shops, fields and livestock (gives a new meaning to the old saying, "Winner takes all"). Twelfth century soccer was a violent sport with little or no rules. (Origins of the Game) ...

17929-jo
land mine record breeders german shepherd joy inside my tears motorcycle riding tip lion king original broadway cast two live crew lyric sweet potato soup recipe womans plus size dress flame gallery tattoo compare car insurance prices ...

hey guys I have added a link for over 1500 free ebooks,please checkou
For increased personal convenience, the E90 is equipped with an FM radio, a music player, a video player and two cameras - a 3.2-megapixel auto focus camera with flash and a second camera for videoconferencing. (more…) ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional