首页 > 解决方案 > 从 SQL Server 中的多个表中进行选择

问题描述

SQL Server 中的这种语法是什么意思?

select top 10 * 
from
    table1 as t1,  
    table2 as t2

这是工会还是加入?它是否将两个表组合在一起?不确定这个语法到底是什么意思?有人有这方面的在线资源吗?

标签: sqlsql-server

解决方案


,是 . 的古老语法cross join。这更通俗地写成:

select top 10 *
from table1 as t1 cross join
     table2 as t2;

也就是说,使用topwithoutorder by是可疑的。


推荐阅读