我想用心靈2個表連接,但是當我嘗試要麼下面的語句,我得到錯誤(1248):每一個派生表必須有它自己的別名INNER JOIN
查詢(1248)錯誤:每個派生的表必須有它自己的別名
SELECT DISTINCT(t2.col)
FROM tab2 as t2
INNER JOIN (
SELECT DISTINCT(t1.col)
FROM tab1 as t1
WHERE t1.id>678 AND t1.id<5248
) ON t2.col=t1.col
WHERE t2.id>10 AND t2.id<3770
SELECT DISTINCT(col)
FROM tab2 as t2
INNER JOIN (
SELECT DISTINCT(col)
FROM tab1 as t1
WHERE t1.id>678 AND t1.id<5248
) ON t2.col=t1.col
WHERE t2.id>10 AND t2.id<3770
什麼問題?
必需的這一個別名'(SELECT DISTINCT(t1.col)FROM TAB1爲t1 WHERE t1.id> 678和t1.id <5248)' – 1000111
注意DISTINCT不是功能。 – Strawberry