![](/img/trans.png)
[英]Query to return tables from mysql database not listed in a column in a table in the database
[英]Explaining MySQL query with multiple tables listed in FROM
a,b沒有直接關系。
a,b與結果有什么關系?
select * from a,b where b.id in (1,2,3)
你能解釋一下sql嗎?
既然你沒有指定的關系a
和b
,這產生交叉產品。 等效於:
SELECT *
FROM a
CROSS JOIN b
WHERE b.id IN (1, 2, 3)
它將a
每一行與b
的三個選定行合並。 如果a
有100行,結果將是300行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.