Fix SQL exception getting statitics with metaquery
Fix SQL exception getting statitics with metaquery

In the scenario with mysql as storage backend, when getting statistics
with metaquery, sqlalchemy will raise an exception of "Unknown column
'sample.id' in 'on clause'", this is because of a wrong usage of JOIN
clause.

Change-Id: I6f140952082ab245f27d576ee9629a086104f8b1
Closes-bug: #1332673

ityaptin/ceilometer,pkilambi/ceilometer,openstack/aodh,idegtiarov/ceilometer,sileht/aodh,cernops/ceilometer,m1093782566/openstack_org_ceilometer,eayunstack/ceilometer,mathslinux/ceilometer,fabian4/ceilometer,MisterPup/Ceilometer-Juno-Extension,MisterPup/Ceilometer-Juno-Extension,redhat-openstack/ceilometer,openstack/ceilometer,chungg/aodh,maestro-hybrid-cloud/ceilometer,redhat-openstack/ceilometer,cernops/ceilometer,Juniper/ceilometer,openstack/ceilometer,pczerkas/aodh,eayunstack/ceilometer,luogangyi/Ceilometer-oVirt,pkilambi/ceilometer,froyobin/ceilometer,luogangyi/Ceilometer-oVirt,Juniper/ceilometer,maestro-hybrid-cloud/ceilometer,r-mibu/ceilometer,mathslinux/ceilometer,isyippee/ceilometer,sileht/aodh,openstack/aodh,m1093782566/openstack_org_ceilometer,pczerkas/aodh,r-mibu/ceilometer,idegtiarov/ceilometer,froyobin/ceilometer,chungg/aodh,ityaptin/ceilometer,fabian4/ceilometer,isyippee/ceilometer