在应使用条件的上下文(在 ',' 附近)中指定了非布尔类型的表达式。

月见寒潭 2015-03-11 09:48:45
SQL语句如下 求解
"select cou_name from course, courseinfo, grade "+
"where grade.cou_id=course.cou_id "+
"and grade.cou_id=courseinfo.cou_id "+
"and grade.stu_id='"+stu_id+"' "+
"and grade.isdual=0 "+
"and (courseinfo.cou_day, courseinfo.cou_time) in "+
"(select cou_day, cou_time from courseinfo where "+
"cou_id='"+cou_id+"')";
...全文
779 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
还在加载中灬 2015-03-11
  • 打赏
  • 举报
回复
(courseinfo.cou_day, courseinfo.cou_time) in (select cou_day, cou_time from courseinfo where cou_id='') 你的SQL版本是多少,貌似到SQL2005都还不支持这种语法,SQL2008以上情况不清楚
唐诗三百首 2015-03-11
  • 打赏
  • 举报
回复
可在程序中设定断点,查看SQL拼接结果,然后手工在查询分析器中执行..

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧