听起来您想在 SMSOutgoing 表中列出包含 uid = 1 的数据库。如果是这样,您应该可以使用UNION
:
SELECT DISTINCT 'DatabaseA' WhichDb
FROM DatabaseA.SMSOutgoing
WHERE uid = 1
UNION
SELECT DISTINCT 'DatabaseB' WhichDb
FROM DatabaseB.SMSOutgoing
WHERE uid = 1
UNION
...
UNION
SELECT DISTINCT 'DatabaseF' WhichDb
FROM DatabaseF.SMSOutgoing
WHERE uid = 1
I used DISTINCT
in case you could have multiple uid in the same table -- that may be unnecessary.
EDIT: From your comments, it sounds like you just want the results:
SELECT *
FROM DatabaseA.SMSOutgoing
WHERE uid = 1
UNION
SELECT *
FROM DatabaseB.SMSOutgoing
WHERE uid = 1
UNION
...
UNION
SELECT *
FROM DatabaseF.SMSOutgoing
WHERE uid = 1
You may need to use UNION ALL
if you might have duplicates...