Ò»¸ö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
?
Ïà¹ØÎÊ´ð£º
select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ'
select cast(convert(numeric(18,2),1275674000000/100000000)as real)
ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
½ñÌì×öÁËÒ»¸ö´æ´¢¹ý³Ì »·¾³ÊÇSQL2000Êý¾Ý¿â
´óÖÂÈçÏÂ
½¨Á¢ÁÙʱ±í
¶¨ÒåÔ±¹¤Óαê
Ñ»·Ô±¹¤£¨ÊôÓÚ1¸ö¹«Ë¾)
......
protected void btnLogin_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
&nb ......