求帮助!C#中把SQL语句定义成string后执行失败,但是同样的内容在MySQL-Front可以执行

MySql 码拜 8年前 (2016-02-09) 842次浏览
下面是SQL语句的string:
public static string rankSQL =
@”update scores,
(select stuId,sptId,score,
(@rank := if(@previous=sptId,@rank,0)+1) as rank,
@previous := sptId
from scores where sptId in
(select sptId from sports where sptType=”田赛”)
order by
sptId,score desc)as rank1
set scores.stuRank=rank1.rank
where scores.stuId=rank1.stuId and scores.sptId=rank1.sptId;
update scores,
(select stuId,sptId,score,
(@rank := if(@previous=sptId,@rank,0)+1) as rank,
@previous := sptId
from scores where sptId in
(select sptId from sports where sptType=”径赛”)
order by
sptId,score)as rank2
set scores.stuRank=rank2.rank
where scores.stuId=rank2.stuId and scores.sptId=rank2.sptId”;
解决方案

80

   按下贴中的方法检查字符集设置。并贴出以供分析。

http://blog.csdn.net/ACMAIN_CHM/archive/2009/05/12/4174186.aspx
MySQL 中文显示乱码


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明求帮助!C#中把SQL语句定义成string后执行失败,但是同样的内容在MySQL-Front可以执行
喜欢 (0)
[1034331897@qq.com]
分享 (0)