This query when ran on the CAST management base will provide the list of source files based analysis units for a given technology, ordered by root path in alphabetical order
You just have to compare the root paths and see if there are some overlap on the others.
A pre-requisite is to identify the two tables you will use, depending on the technology :
In management base, for each technology you have one table containing the analysis units and one table containing the projects.
Their names are CMS_<TECHNO>_ANALYSIS and CMS_<TECHNO>_PROJECT.
For instance, for Java you have tables CMS_J2EE_ANALYSIS and CMS_J2EE_PROJECT.
For .Net you have CMS_NET_ANALYSIS and CMS_NET_PROJECT.
For C++ you have CMS_CPP_ANALYSIS and CMS_CPP_PROJECT