Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 3 of 3 total |
SQL Question |
Tue, Feb 12 2008 1:41 PM | Permanent Link |
"Nowhere" | I would like to know how to do the following
I want to compare 2 identical structured tables and create a result set of just those records where there is data difference in 1 or more of the fields held in each record (I assume this would mean both records need to be included so I could identify both values although it might be handy just to have the contents of 1 of the tables as another choice) I was told that the following UNION construct works but this is not DBISAM SELECT * FROM ( SELECT ID, USERNAME,EMAIL FROM KEYS UNION ALL SELECT ID,USERNAME,EMAIL FROM SNAPSHOT ) tmp GROUP BY ID, USERNAME,EMAIL HAVING COUNT (*) = 1 ORDER BY ID Apparantly the HAVING statement ensures selecting all records where at least 1 field differs Will this work in Version 3 and/or version 4 of DBISAM (or something similar) or failing that what is the best way to go about it (Assume Version 3 please) Many thanks Mike -- |
Tue, Feb 12 2008 2:43 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Mike,
Use this script (DBISAM 3): SELECT ID, USERNAME,EMAIL INTO MEMORY Temp FROM KEYS UNION ALL SELECT ID,USERNAME,EMAIL FROM SNAPSHOT; SELECT * FROM MEMORY Temp GROUP BY ID, USERNAME,EMAIL HAVING COUNT (*) = 1 ORDER BY ID; Just be sure to delete the in-memory Temp table when you're done working with it. -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Feb 12 2008 3:27 PM | Permanent Link |
"Nowhere" | Many thanks for the quick reply
Mike |
This web page was last updated on Wednesday, April 24, 2024 at 11:07 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |