SQL query cck fields 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
You could use the Forena module to create a report using the data block that matches your "mock up query". While doing so, you could also use the WYSIWYG query writing facilities to further tune your query if needed (think of it as using PhpMyAdmin integrated within your Drupal site).

Visit the demo site samples for more details, and/or refer to 2 types of documentation that's available:


Community documentation, which includes a child page Video demos and tutorials.
Documentation that comes with Forena, which you can access right after install and enable of the module. Checkout the demo site for an online example of it.


Disclosure: I'm a (co-)maintainer of Forena.