PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

Recupera i post da utenti che non bloccano

Un modo per farlo con SQL sarebbe:

select *
  from post
  where user_id not in 
    (select blocker_id 
    from blockings
    where blocked_id = 1);

Basta sostituire l'id numerico con la variabile.

SQL Fiddle