Skip to content
Advertisement

PostgreSQL – error when performing not in

here is the table:

Now I’d like to get the new users on day 2019-01-01. Here is my answer:

then get this error:

any idea of this? I already checked that all the subqueries work. Thanks

Advertisement

Answer

user is a reserved word which resolves to the name of the currently logged-in PostgreSQL user. You can see this by doing something like:

To have it refer to a table column alias spelled “user”, you need to qualify it with a table name, or put it in double quotes, or better yet just spell it differently to start with.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement