I have the following postgresql query which selects a few fields from a table called statement_bank:
SELECT statement_id, statement_value FROM statement_bank WHERE category_id=6 AND level=7
I have another table called statement_records, and the fields for that table are:
date | user_id | statement_id
Once a statement is used for a particular user_id, the statement_id is recorded in the statement_records table. This may be recorded a few times for different users.
I am looking to run the first query so that it only returns the statement_id's from the statement_bank table if it exists in the statement_records table between a specific date e.g. between 01-01-2013 AND 01-01-2014
Any suggestions on how I can achieve this?
Thanks