Heya, what i would like to do in one query is pull out two objs, that are very similar from the same table "ol_obj_data"
These two objs are "ratings" and "reviews" they are not linked except for a USER_ID of who submitted them. But they relate to our business data.
ie, if a user has submitted a review (cat_id=8) and a rating (cat_id=9) into table "ol_obj_data", then the business is considered connected to the user.
SELECT od.cat_id,od.obj_id,od.date_added,od.date_updated,od.data,bc.title,bc.business_contacts_id,gde.addre ss_string
FROM ol_obj_data od
INNER JOIN ol_obj_2_business o2b ON od.obj_id = o2b.obj_id
INNER JOIN ol_business_contacts bc ON o2b.business_contacts_id = bc.business_contacts_id
INNER JOIN ol_geo_data_ext gde on gde.geo_id=bc.geo_id
WHERE od.uid = USER_ID AND od.cat_id = 8
This query selects all the business records connected to a user which also have a rating by that user in ol_obj_data.
What i need to do is have a query that can
Select those same business records connected to the user, if that user has not only a rating, but also a review in "ol_obj_data" but no idea how to combine that together.
ie. if theres a obj with cat_id=8, and a obj with cat_id=9 both with same user_id, get business records
If that doesn't make sense im sorry and will try to explain it further.
thanks for any help