P piaoyun1987 Unregistered / Unconfirmed GUEST, unregistred user! 2008-03-22 #1 请各位前辈指点:(急需)<br>select Count(成绩=良好) as 次数, from student <br>中总是出现等号附近有语法错误,该怎么写啊? 代码:
L lanyaoshi Unregistered / Unconfirmed GUEST, unregistred user! 2008-03-22 #2 select Count(*) as 次数, from student where 成绩='良好'
C cgs1980 Unregistered / Unconfirmed GUEST, unregistred user! 2008-03-22 #4 如果使用 select Count(*) as 次数, from student where 成绩='良好',仍然出现错误,可以试一下下面的语句:<br>q.SQL.Text := 'select Count(*) as 次数 from student where 成绩=:strGrade';<br>q.Parameters.ParamByName('strGrade').Value := '良好';<br>q.Open;
如果使用 select Count(*) as 次数, from student where 成绩='良好',仍然出现错误,可以试一下下面的语句:<br>q.SQL.Text := 'select Count(*) as 次数 from student where 成绩=:strGrade';<br>q.Parameters.ParamByName('strGrade').Value := '良好';<br>q.Open;
P power255 Unregistered / Unconfirmed GUEST, unregistred user! 2008-03-24 #5 select Count(*) as 次数 from student where 成绩='良好'<br>次数后面不能有,号
0 007vivi Unregistered / Unconfirmed GUEST, unregistred user! 2008-03-29 #7 select Count(*) as 次数 from student where 成绩='良好'
L lngdtommy Unregistered / Unconfirmed GUEST, unregistred user! 2008-03-29 #8 不建议有事没事的都用参数传递这样,会引起问题。<br>可以这样写<br>q.SQL.Text := 'select Count(*) as 次数 from student where 成绩=''良好'' ';<br>q.Open;
不建议有事没事的都用参数传递这样,会引起问题。<br>可以这样写<br>q.SQL.Text := 'select Count(*) as 次数 from student where 成绩=''良好'' ';<br>q.Open;