Here is my select:
SELECT entry_table.*, count(response_table.r_id) as r_count, category_table.c_name
FROM entry_table
JOIN category_table
ON (category_table.c_id = entry_table.c_id )
LEFT JOIN response_table
ON entry_table.e_id=response_table.e_id
GROUP BY entry_table.e_id
ORDER BY entry_table.e_timestamp DESC
The goal is to select from three tables:
i want all columns from entery_table.
I want only the category name ('c_name') from the category, but it must be specific to the entry assocciated with that record, however, there CAN be entries with no matching c_id (i.e. - no category), and i want those too, those are the ones falling off the query/not geting returned...
And then, count of response records that also have that entry ID (e_id) assocciated with that record.
ive never been good with sql... HELP! :-D thanks