I want to query if a specific content type has a photo in a custom cck field. I could probably create a View to find this? My mock up query is below. the photo is inside the table 'content_field_photo' in the row 'field_photo_data' inside this table is another row called 'nid' and this nid value should be present in the content type table called 'content_type_contenttype'
SELECT * from content_field_photo WHERE content_field_photo.field_photo_data IS NOT NULL AND nid is in content_type_contenttype.nid