joined:Sept 30, 2009
I have two tables: 'places', 'reviews'
- id, int(10), unsigned, auto_increment, PRIMARY
- name, varchar(255)
- address, text
- id, int(10), INDEX
- comment, text
Each row has a unique id in the 'places' table, where as in the 'reviews' table, there can be multiple rows with the same id.
What I'm trying to do is to query my 'places' table but to create a new column called reviews that has the count of how many rows in the 'reviews' table matches the id in a given row in the 'places' table.
My current query looks like this:
"SELECT * FROM places"
Any help is greatly appreciated.