Fixed the query when merging linked and used resources

Authored by ivan on Aug 17 2017, 10:34 AM.