Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Ò»¸öSQL²éѯÎÊÌâ

±í×Ö¶Î
Answerid    Questionid    NAME        sort
1            2            test1      4
2            1            test1      5
3            1            test2      1
4            2            test2      3
5            5            test2      6
6            7            test2      2


ÎÒҪͳ¼Æ NAME=test2 µÄQuestionid£¬°´ÕÕsortÅÅÐò£¬²¢ÇÒ»¹Òªcount(Answerid)
ÎҵIJéѯÓï¾äÊÇ£º
SELECT COUNT(Answerid) AS Counts, Questionid
from t
WHERE  (Questionid IN(SELECT Questionid from t WHERE (NAME = 'test2')))
GROUP BY Questionid

Êý¾ÝÊÇÄܲéѯ³öÀ´£¬µ«ÊÇÎÒ²»ÖªµÀ¸ÃÔõôÓÃsort½øÐÐÅÅÐò£¬Çó¸ßÊÖ½â´ð¡«¡«


SQL code:
SELECT COUNT(Answerid) AS Counts, Questionid
from t
WHERE NAME = 'test2' GROUP BY Questionid ORDER BY sort
?


Ïà¹ØÎÊ´ð£º

sqlת»»ÎÊÌ⣬¼±£¡ - ÉçÇøÖ§³Ö / ¡¶³ÌÐòÔ±¡·ÔÓÖ¾

select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ'
select cast(convert(numeric(18,2),1275674000000/100000000)as real)
ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......

jspÁ´½Ósql2000µÄÒÉÎÊ£¿



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

SQLÈçºÎÓÅ»¯ÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

½ñÌì×öÁËÒ»¸ö´æ´¢¹ý³Ì   »·¾³ÊÇSQL2000Êý¾Ý¿â  
´óÖÂÈçÏÂ
½¨Á¢ÁÙʱ±í
¶¨ÒåÔ±¹¤Óαê
        Ñ­»·Ô±¹¤£¨ÊôÓÚ1¸ö¹«Ë¾)  
        ......

ASPÁ´½ÓSQLµÄ¼òµ¥µÇ½½çÃæ - .NET¼¼Êõ / ASP.NET

protected void btnLogin_Click(object sender, EventArgs e)
  {
  SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
&nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ