I have two tables, for example:
REQUEST(requestId,firstName,lastName,email)
RESPONSE(responseId,requestId,message)
I want to pull all the records from request. In the query I want to count how many records there are in the RESPONSE table for each REQUEST record, like this...
SELECT REQUEST.*, COUNT(RESPONSE.*) FROM REQUEST, RESPONSE WHERE REQUEST.requestId=RESPONSE.requestId GROUP BY requestId;
Here's the catch... Unfortunately, there won't always be records in the RESPONSE table for every record in the REQUEST table. So, obviously this query is flawed. How can I pull every record from the REQUEST table (even those which don't have a RESPONSE record)?
Many, many thanks in advance.