一个标准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(右连接);

 

posted @ 2019-10-22 22:39  吉光一片羽  阅读(616)  评论(1编辑  收藏  举报