SQL Query SCCM

Primary user on device

With this query you get a list of devices and topuser (primary user) on device