Forums

Two tables and two db models read and compare condition needed

saveg 31 Jan, 2020
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?
saveg 31 Jan, 2020
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';
                )
healyhatman 31 Jan, 2020
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
saveg 01 Feb, 2020
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.
This topic is locked and no more replies can be posted.