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

Per utilizzare un'altra tabella come criteri WHERE in SQL

prova:

SELECT q.question_id, q.title
    FROM questions      q
        INNER JOIN tags t ON q.question_id=t.question_id
    WHERE tag = $1 
    ORDER BY q.was_sent_at_time
    DESC LIMIT 50