Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Join node table with a field table and search for published nodes of a certain type with a specific field value:
- SELECT node.nid AS node_id,
- LEFT(node.title, 10) AS node_title, field_data_field_reference_database_id.field_reference_database_id_value as ref_id
- FROM node
- LEFT JOIN field_data_field_reference_database_id
- ON node.nid = field_data_field_reference_database_id.entity_id
- WHERE type='location'
- AND status='1'
- AND field_data_field_reference_database_id.field_reference_database_id_value IS NULL;
Add Comment
Please, Sign In to add comment