sqlÓï¾äµÄÒÉ»ó
SQL code:
select Hinge,count(Hinge) as HingeCount from dbo.Question where HingeCount>5 group by Hinge order by HingeCount desc
ÆäÖÐHingeCount>5ÕâÑùдΪʲô²»ÐУ¬ÌáʾHingeCountÎÞЧ
SQL code:
select Hinge,count(Hinge) as HingeCount from dbo.Question
group by Hinge having(count(Hinge))>5 order by HingeCount desc
SQL code:
select Hinge,
count(Hinge) as HingeCount
from dbo.Question
group by Hinge
having count(Hinge)>5
ÒòΪÄãµÄÄǸöHingeCountÊDZðÃû
SQL code:
--還ÊÇ
select * from(
select Hinge,
count(Hinge) as HingeCount
from dbo.Question group by Hinge )t
where HingeCount>5 order by HingeCount desc
SQLÂß¼´¦Àí˳Ðò
SQL code:
(8) SELECT (9) DISTINCT (11) <TOP_specification> <select_list>
(1) from <left_table>
(3) <join_type> JOIN <right_table>
(2)
Ïà¹ØÎÊ´ð£º
select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ'
select cast(convert(numeric(18,2),1275674000000/100000000)as real)
ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......
ÎÒÒ»¸öÏîÄ¿£¬Óиö²åÈë²Ù×÷£¬¾ßÌåÊÇÕâÑùµÄ£º
ÎÒÓнø»õÐÅÏ¢±í¡£ÔÚ³ö»õʱѡÔñÏàÓ¦µÄ½ø»õÐÅÏ¢£¬ÊäÈëÊýÁ¿£¬Ñ¡Ôñ²¿Ãź󣬵㱣´æ°´Å¥£¬ÓÉÓÚÍøÂçÑÓʱ£¬µãÒ»ÏÂûÓз´Ó³£¬ÓÚÊÇÓû§¾ÍÓÖµãһϣ¬µ¼ÖÂÒ»´Î²åÈëÁËÁ½Ìõ¼Ç¼:
Àý£º
......
ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle)
ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄǰ2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......
tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname
½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......