I am trying to exclude a series of test users from 'test\_user' table by using `NOT IN`.

![test_user table](https://i.stack.imgur.com/41CYS.jpg)

I got another 'member' table with userID and other information

![member table](https://i.stack.imgur.com/Zzh1b.jpg)

Originally, the tester user table is not too long, so people use `NOT IN` clause to exclude test users by listing their ID, but as the test users increase day by day, I am wondering if there is any way to keep this `NOT IN ()` up-to-date and easy to maintain.

I am not sure if there is any solution like:

```
@declare test_user varchar(23) = select ID from test_user

SELECT * FROM member WHERE ID NOT IN (@test_user)

```

Thanks for your help!