
                select
                    robj.LpuUnit_id as "LpuUnit_id"
                from
                    r52.v_RegistryLpuUnit robj
                    inner join lateral(
                        select RegistryQueue_id
                        from r52.v_RegistryQueue
                        where robj.RegistryQueue_id = RegistryQueue_id
                        UNION ALL
                        select RegistryQueue_id
                        from r52.v_RegistryQueue
                        where robj.Registry_id = Registry_id
                    ) rq on true
                where
                    rq.RegistryQueue_id in (520101000170172)
                limit 1
            
