I have a user relation to address (1 to 1).
So the address has two types which is a
One is the
VerifiedAddress and the other one is the
So the user who had verified his address has two entries in the addresses table.
In case you wonder why is that, the reason is that user can go to a travel and change the
SearchAddress but the
VerifiedAddress remains the same.
I'm trying to find all the users who haven't got verified their address. I have some user list from which I know who has verified address and who hasn't got it.
This is what I have tried the last, not exactly what I wanted :
select id from addresses
where user_id in (8112, 18620, 23, 19668, 10212)
and type = 'VerifiedAddress';
Gives me all the verified users, but if I change the
type != VerifiedAddress I still get the same results because users who have verified their address have two entries in a addresses table, this time I get the user_ids from the
How can I get this data from addresses table?
SearchAddress can be null as well as
VerifiedAddress. Naturally people who don't have searchaddress don't have the verified as well.