Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Darn Drupal
SELECT
node.nid AS nid,
node_data_field_spot_permalink.field_spot_permalink_value AS node_data_field_spot_permalink_field_spot_permalink_value,
node.type AS node_type,
node.vid AS node_vid,
node_data_field_spot_permalink.field_spot_image_fid AS node_data_field_spot_permalink_field_spot_image_fid,
node_data_field_spot_permalink.field_spot_image_list AS node_data_field_spot_permalink_field_spot_image_list,
node_data_field_spot_permalink.field_spot_image_data AS node_data_field_spot_permalink_field_spot_image_data,
node.title AS node_title,
node_data_field_spot_permalink.field_spot_bloggname_value AS node_data_field_spot_permalink_field_spot_bloggname_value,
node_data_field_spot_permalink.field_spot_blogglink_value AS node_data_field_spot_permalink_field_spot_blogglink_value,
term_data.name AS term_data_name,
term_data.vid AS term_data_vid,
term_data.tid AS term_data_tid,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format,
node.sticky AS node_sticky,
node_data_field_pub_date.field_pub_date_value AS node_data_field_pub_date_field_pub_date_value,
node.created AS node_created
FROM node node
INNER JOIN content_field_spot_place node_data_field_spot_place ON node.vid = node_data_field_spot_place.vid
LEFT JOIN content_field_pub_date node_data_field_pub_date ON node.vid = node_data_field_pub_date.vid
LEFT JOIN content_type_spot node_data_field_spot_permalink ON node.vid = node_data_field_spot_permalink.vid
LEFT JOIN term_node term_node ON node.vid = term_node.vid
LEFT JOIN term_data term_data ON term_node.tid = term_data.tid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE ((node.type in ('spot'))
AND (node_data_field_spot_place.field_spot_place_value = 'start_middle')
AND (node.status <> 0)
AND (node.promote <> 0)
) AND (TO_CHAR(node_data_field_pub_date.field_pub_date_value::timestamp with time zone AT TIME ZONE 'Europe/Stockholm', 'YYYY-MM-DD"T"HH24:MI') <= '2011-08-30T09:49')
ORDER BY
node_sticky DESC,
node_data_field_pub_date_field_pub_date_value DESC,
node_created DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.