wiki:Internal/GoodJoin

Gets the locations of the most recent checkin

SELECT check_in.time, locations.x,locations.y,testbeds.node_domain 
FROM check_in 
LEFT JOIN locations ON check_in.id = locations.id 
LEFT JOIN testbeds ON locations.testbed_id = testbeds.id 
WHERE 1 
ORDER BY `check_in`.`time`  DESC

X,Y coordinates of a specific device:

SELECT locations.x,locations.y,nodes.motherboard_id,device_kinds.description
FROM nodes
LEFT JOIN locations ON nodes.location_id = locations.id
LEFT JOIN devices ON nodes.motherboard_id = devices.motherboard_id
LEFT JOIN device_kinds on devices.device_kind_id = device_kinds.id
WHERE 
(devices.device_kind_id = 41 OR devices.device_kind_id = 32)
AND locations.testbed_id = 1
ORDER BY locations.x,locations.y
Last modified 13 years ago Last modified on Jun 21, 2011, 4:15:10 PM
Note: See TracWiki for help on using the wiki.