Skip to content

Instantly share code, notes, and snippets.

@nicl
Created January 17, 2020 16:56
Show Gist options
  • Save nicl/e239ed56da2d2771380d1a51219a6deb to your computer and use it in GitHub Desktop.
Save nicl/e239ed56da2d2771380d1a51219a6deb to your computer and use it in GitHub Desktop.
select
talk_node.nid as id,
talk_meta.title as title,
node__field_talk_description.field_talk_description_value as description,
speaker_meta.title as author,
talk_meta.created as timestamp,
DATE_FORMAT(FROM_UNIXTIME(talk_meta.created), '%d/%m/%y') as date
from
node as talk_node,
node as speaker_node,
node__field_talk_description,
node_field_revision as talk_meta,
node_field_revision as speaker_meta,
node__field_speaker
where
talk_node.nid = node__field_talk_description.entity_id AND
talk_node.vid = talk_meta.vid AND
node__field_speaker.revision_id = talk_node.vid AND
node__field_speaker.field_speaker_target_id = speaker_node.nid AND
speaker_node.vid = speaker_meta.vid
;
@nicl
Copy link
Author

nicl commented Jan 17, 2020

mysql --batch -e ".." was what I used for tab-separated results. This is fine as fortunately we don't use tabs in our titles or descriptions, but it's not particularly robust as a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment