0

我有一个包含很多连接的查询,使我的总列数超过 1000。为了解决这个限制,我需要使用 select * 而不是手动定义别名。

我想要做

SELECT    *
FROM      table0 t0
INNER JOIN table1 t1
ON         t0.field = t1.field
WHERE      rownum < 10

在我的结果中,我需要在列名中定义以下内容

t0.column
t0.column2
t1.column
t1.column2

是否有我缺少的概念或技术来实现这一点?我真的不想依赖现场顺序,因为它可能会改变。

4

3 回答 3

0

也许你可以提出一个提示:

SELECT t1.*, 't1 <-> t2' , t2.*,  't2 <-> t3', t3.*

现在你最终会看到这样的东西:

 t1...................................|           | t2................|           | t3.....................|
 01-02-2012 | ... | More data from t1 | t1 <-> t2 | Some data from t2 | t2 <-> t3 | Now data from t3 | ... |
 01-02-2012 | ... | More data from t1 | t1 <-> t2 | Some data from t2 | t2 <-> t3 | Now data from t3 | ... |
 01-02-2012 | ... | More data from t1 | t1 <-> t2 | Some data from t2 | t2 <-> t3 | Now data from t3 | ... |
 01-02-2012 | ... | More data from t1 | t1 <-> t2 | Some data from t2 | t2 <-> t3 | Now data from t3 | ... |
 01-02-2012 | ... | More data from t1 | t1 <-> t2 | Some data from t2 | t2 <-> t3 | Now data from t3 | ... |
 01-02-2012 | ... | More data from t1 | t1 <-> t2 | Some data from t2 | t2 <-> t3 | Now data from t3 | ... |

而且您知道这些标记之间的所有内容都't1 <-> t2'属于表格。

于 2012-11-11T07:32:43.147 回答
0

您可以执行以下操作:

SELECT t0.column, t0.column2, t1.column, t1.column2, t0.*, t1.* 
FROM      table0 t0
INNER JOIN table1 t1
ON         t0.lm_mst_uid = t1.lm_mst_uid
WHERE      rownum < 10
于 2012-11-09T18:09:56.783 回答
0
SELECT    t0.*, t1.*
FROM      table0 t0
INNER JOIN table1 t1
ON         t0.lm_mst_uid = t1.lm_mst_uid
WHERE      rownum < 10
于 2012-11-09T18:13:28.727 回答