Skip to content

Instantly share code, notes, and snippets.

@tarto-dev
Created March 31, 2014 09:30
Show Gist options
  • Select an option

  • Save tarto-dev/9888707 to your computer and use it in GitHub Desktop.

Select an option

Save tarto-dev/9888707 to your computer and use it in GitHub Desktop.
SELECT
DISTINCT(node.nid) AS nid,
node.title AS node_title,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format,
node_data_field_photo_carrousel_little.field_photo_carrousel_little_fid AS node_data_field_photo_carrousel_little_field_photo_carrousel_little_fid,
node_data_field_photo_carrousel_little.field_photo_carrousel_little_list AS node_data_field_photo_carrousel_little_field_photo_carrousel_little_list,
node_data_field_photo_carrousel_little.field_photo_carrousel_little_data AS node_data_field_photo_carrousel_little_field_photo_carrousel_little_data,
node.type AS node_type,
node.vid AS node_vid,
node_data_field_highlighted.field_highlighted_value AS node_data_field_highlighted_field_highlighted_value,
DATE_FORMAT((FROM_UNIXTIME(node.changed) + INTERVAL 7200 SECOND), '%Y%m%d%H%i') AS node_changed_minute
FROM
node node
LEFT JOIN
node_revisions node_revisions ON node.vid = node_revisions.vid
LEFT JOIN
content_type_temoignages_detail node_data_field_photo_carrousel_little ON node.vid = node_data_field_photo_carrousel_little.vid
LEFT JOIN
content_type_temoignages_detail node_data_field_highlighted ON node.vid = node_data_field_highlighted.vid
WHERE
node.type in ('temoignages_detail')
GROUP BY
nid
ORDER BY
node_data_field_highlighted_field_highlighted_value DESC,
node_changed_minute DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment