Is it possible you can get everything you need using the web resource Universal Device Poller Top XX (where XX is the number of devices you've assigned the poller)?
Customize page --> Add resource --> Universal Device Poller Top XX
Sometimes after I've gone the SQL route (and asked for help) I end up finding a more straightforward way (or a way I can do without assistance) using more native functionality. (And other times I get into complex SWQL). I've been running 10.7 for perhaps nine months and have found more and more that I can do from the web natively. Or from SWQL via the web. How does 'Universal Device Poller Top XX' work for you?
More than likely, you don't need any custom SQL here. Have you tried adding a 'Custom Table' resource to your dashboard view.