Hello Everyone,
I need to build a query and I'm having a terrible time getting my head around it. Here are the details of the tables:
Table1: MESSAGES
Table2: FOLDERS
Each message, in the messages table is assigned a folder by FOLDER_ID.
I want to count messages in the MESSAGES table that match a FOLDER_NAME, and not the FOLDER_ID. The folder name is stored in the FOLDERS table.
The folder names change over time, so I use "LIKE" to find keywords in the folder name.
SO - how do I structure the query to say:
SELECT count(*) from MESSAGES where completed = 0 AND FOLDERID = ??????? (name?)
You see, I want to query by folder name which is in a separate table. Any ideas?
I need to build a query and I'm having a terrible time getting my head around it. Here are the details of the tables:
Table1: MESSAGES
Table2: FOLDERS
Each message, in the messages table is assigned a folder by FOLDER_ID.
I want to count messages in the MESSAGES table that match a FOLDER_NAME, and not the FOLDER_ID. The folder name is stored in the FOLDERS table.
The folder names change over time, so I use "LIKE" to find keywords in the folder name.
SO - how do I structure the query to say:
SELECT count(*) from MESSAGES where completed = 0 AND FOLDERID = ??????? (name?)
You see, I want to query by folder name which is in a separate table. Any ideas?