Update sqlqueries for getting devices in app with no logs