ENH: Improve SQL query
ENH: Improve SQL query

cpatrick/CDash,cpatrick/CDash,cpatrick/CDash,jcfr/CDash,jcfr/CDash,jcfr/CDash,jcfr/CDash,cpatrick/CDash,jcfr/CDash,cpatrick/CDash,cpatrick/CDash,jcfr/CDash