Buy Now
Sign in

Two tables and two db models read and compare condition needed

saveg , January 31 2020, 17:03
S
saveg 90
January 31 2020, 17:03 #390981
I have two identical tables but different contents.
I just want to make a db read for these two tables and make a quick compare:
Lets say Temp Table and Final Table.
I want to get the users who exists in Temp but not in Final.
and of course put them in an array to send them to Acyba,
can this be done quickly in DB Read action?
S
saveg 90
January 31 2020, 17:54 #390982
here is my setup whichdoes not bring users whose in temp only. I just want users in temp table. the primary key in both tables arent similar. and the only comparison I want to do is userid
Im sure this is possible but how?
sql is now like this
SELECT COUNT(`Temp`.`aid`) AS `Temp.count` FROM `rkjac_chronoforms_data_XXXXTMP` AS `Temp` WHERE `Temp`.`user_id` != 'Final.user_id';
)
twodbs2Screenshot_2020-01-31-_Administration.png
Attachments
healyhatman 9
January 31 2020, 23:09 #390991
Not subquery join, I still have no idea how that works. You want the normal join, and in your WHERE conditions you want table2.the_field = NULL
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
S
saveg 90
February 01 2020, 08:56 #390994
thanks for the reply
I think Ive found a solution using
two db reads
and doing this condition onthe tempdb read action
Temp.user_id/NOT IN:{var:read_data6.[n].Final.user_id}
Im not sure though if it will skip some records or not.
but I can see users who exist in temp and not existing on final.