Before we go into details of building the query, let me understand the reason why you would like to build the query.
Is it to find out where the object is exported to? If that's the case then there is already a run-time property called "export_sites" (I think the display name is "Exported To").
Is it to search and delete export records, so you can delete the master object without deleting replicas first? If that's the case then I would strongly advice against this. This can lead to lot of problems, unless you go and delete the replicas too. Replicas could have been used in BOM.