WIP: adding query for device and device_tab compare