2015-04-01 39 views
-5
SELECT something 
FROM table1, table2, table 
WHERE tableColumn = "tableName" 
+0

什麼?你是否要求所有具有特定列名的表?您是否要求使用特定列名查找所有表的代碼生成器,然後對這些表執行查詢?你是否要求一個連接,其中table1,table2和table3在列中都具有相同的值? 「 – CindyH 2015-04-01 22:20:05

+0

」你是否要求所有在其中具有特定列名的表?是 – Berna 2015-04-01 22:22:16

+1

http://stackoverflow.com/a/9180068/2589202 – paqogomez 2015-04-01 22:41:27

回答

0

你可以做一些瘋狂,複雜的關於模式的表,如果有必要,但這應該在緊要關頭:

select <something> 
    from table1 
    where 
     tableColumn = "tableName" 
union all 
select <something> 
    from table2 
    where 
     tableColumn = "tableName" 
union all 
select <something> 
    from table3 
    where 
     tableColumn = "tableName" 

只要確保從聯合中的每個查詢中選擇相同類型的列。