一个标准sql语句模板

select distinct top n *
from t1 inner join t2 on ... join t3 on ...
where ...
group by ... having ...
order by ...

top n:选出查询结果的前n项,可改为 top n percent 形式:选出查询结果的前百分之n项;

inner join:内连接查询,可改为left join(左连接)、right join(右连接);

猜你喜欢

转载自www.cnblogs.com/ShadowCharle/p/11723161.html