Postgres: how to find absent users in DB

后端 未结 2 413
庸人自扰
庸人自扰 2021-01-29 09:44

Regular tasks when need to compare two db. Somene has sent me list of users, that should be in my database. 127 positions.

When I make SELECT * FROM users WHERE id

2条回答
  •  隐瞒了意图╮
    2021-01-29 10:36

    Based on your comment:

    select * from [given_list] EXCEPT select * from [already_in_database] 
    

    This will return the users who are in one list but not the other.

    Obviously, without more information it is hard to make use of primary keys, and so forth

提交回复
热议问题