Skip to content

Instantly share code, notes, and snippets.

@OliverUv
Created July 1, 2012 13:21
Show Gist options
  • Save OliverUv/3028413 to your computer and use it in GitHub Desktop.
Save OliverUv/3028413 to your computer and use it in GitHub Desktop.
$query = "
SELECT
tn.id AS id,
tn.skeleton_id AS skeleton_id,
(tn.location).x as x,
(tn.location).y as y,
(tn.location).z AS z,
greatest(tn.creation_time, tn.edition_time) AS most_recent,
'treenode' as type
FROM
treenode tn
WHERE
tn.project_id = $pid AND
tn.skeleton_id = $skid AND
tn.user_id = $uid
ORDER BY most_recent DESC
LIMIT 1";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment