This is a discussion on Show differences between two tables within the MySQL General forum forums, part of the MySQL category; --> Hi I've two tables TableA FieldID Enabled TableB FieldID Enabled What query would I need to show what FieldIDs ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi I've two tables TableA FieldID Enabled TableB FieldID Enabled What query would I need to show what FieldIDs which are the same, but the enabled field status is different ?Thanks, Neil __________________________________________________ _______________ Be one of the first to try Windows Live Mail. http://ideas.live.com/programpage.as...e-4911fb2b2e6d |
| |||
| Neil Tompkins wrote: > Hi > I've two tables > > TableA > FieldID > Enabled > > TableB > FieldID > Enabled > > What query would I need to show what FieldIDs which are the same, but the enabled field status is different ?Thanks, > Neil > __________________________________________________ _______________ > Be one of the first to try Windows Live Mail. > http://ideas.live.com/programpage.as...e-4911fb2b2e6d How about SELECT a. FieldID, a.Enabled, b.Enabled FROM TableA b, TableB b WHERE a.FieldID=B.FieldID and a.Enabled <> b.Enabled -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
| |||
| Hi Neil - Something like this ought to work, joining on the ID column to find matches between tables, then finding the enabled fields which are not equal. SELECT a.fieldID, a.enabled, b.enabled FROM TableA a, TableB b WHERE a.fieldID = b.fieldID AND a.enabled != b.enabled Dan On 9/15/06, Neil Tompkins <neildtompkins@hotmail.com> wrote: > > Hi > I've two tables > > TableA > FieldID > Enabled > > TableB > FieldID > Enabled > > What query would I need to show what FieldIDs which are the same, but the > enabled field status is different ?Thanks, > Neil > __________________________________________________ _______________ > Be one of the first to try Windows Live Mail. > > http://ideas.live.com/programpage.as...e-4911fb2b2e6d > |
| ||||
| This may be the blind leading the one-eyed, but wouldn't SELECT FieldID FROM TableA, TableB WHERE TableA.FieldID = TableB.FieldID AND TableA.Enabled != TableB.Enabled; Work? Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -----Original Message----- From: Neil Tompkins [mailto:neildtompkins@hotmail.com] Sent: Friday, September 15, 2006 5:04 AM To: mysql@lists.mysql.com Subject: Show differences between two tables Hi I've two tables TableA FieldID Enabled TableB FieldID Enabled What query would I need to show what FieldIDs which are the same, but the enabled field status is different ?Thanks, Neil __________________________________________________ _______________ Be one of the first to try Windows Live Mail. http://ideas.live.com/programpage.as...-4314-9b0e-491 1fb2b2e6d |