A standard sql statement template

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

 

top n: n items selected before the query results, can be changed to top n percent form: select top n items per query results;

inner join: the join query, may instead be left join (left connection), right join (right connection);

 

Guess you like

Origin www.cnblogs.com/ShadowCharle/p/11723161.html