I have following query:
select user_id, trajectory_id, count(trajectory_id) from point group by user_id, trajectory_id
It returns following result:
And I want to delete all records from point
table where count
in produced table is < 5.
Right now I have following query, but it is not compiling. What is wrong with it and how can I fix it?
delete
from point
where count(trajectory_id) < 5
GROUP BY user_id, trajectory_id
I am using Postgres.