Skip to content

Instantly share code, notes, and snippets.

@phillipadsmith
Created May 14, 2009 15:12
Show Gist options
  • Save phillipadsmith/111703 to your computer and use it in GitHub Desktop.
Save phillipadsmith/111703 to your computer and use it in GitHub Desktop.
SELECT node.nid AS node_id,
FROM_UNIXTIME(node.created) AS created,
node.title,
nr.teaser,
nr.body AS text,
( SELECT GROUP_CONCAT( name SEPARATOR ':' ) AS name_list FROM ( term_data LEFT JOIN (term_node) ON term_data.tid = term_node.tid ) WHERE term_node.nid=node_id ) AS keywords,
CONCAT_WS("/","http://interact.newint.org",url_alias.dst) AS slug
FROM node,
term_node AS tn,
node_revisions as nr,
url_alias
WHERE node.nid=tn.nid
AND nr.nid=node.nid
AND url_alias.src LIKE CONCAT_WS("/","node",nr.nid)
AND node.uid=16
GROUP BY node.title
ORDER BY node.nid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment