子查询问题?高手请进
"SELECT hdiqtest_question.RecID FROM hdiqtest_question
WHERE convert(varchar,hdiqtest_question.RecID) NOT IN (SELECT convert(varchar,hdiqtest_records.QuestionID) FROM hdiqtest_records WHERE UserName='keen')";
RecID是hdiqtest_question里的字段
QuestionID,UserName是hdiqtest_records里的字段,原意是把hdiqtest_records里UserName=keen且QuestionID=RecID出现的记录不要
每次出现You have an error in your SQL syntax near 'varchar,hdiqtest_question.RecID) NOT IN (SELECT convert(varchar,hdiqtest_records'
请指教
WHERE convert(varchar,hdiqtest_question.RecID) NOT IN (SELECT convert(varchar,hdiqtest_records.QuestionID) FROM hdiqtest_records WHERE UserName='keen')";
RecID是hdiqtest_question里的字段
QuestionID,UserName是hdiqtest_records里的字段,原意是把hdiqtest_records里UserName=keen且QuestionID=RecID出现的记录不要
每次出现You have an error in your SQL syntax near 'varchar,hdiqtest_question.RecID) NOT IN (SELECT convert(varchar,hdiqtest_records'
请指教
...全文
相关推荐
使用SQL Server数据库嵌套子查询的方法
使用SQL Server数据库嵌套子查询的方法
什么是子查询?相关子查询的性能问题?
子查询依赖于外层查询的列,每执行外层的一行,子查询都会重新执行一次。
子查询经典案例题目.pdf
子查询经典案例题目.pdf
经典sql面试题目----无私奉献了!!!
经典sql面试题目----无私奉献了!!!希望对你们有帮助
mysql中count(), group by, order by使用详解
mysql中order by 排序查询、asc升序、desc降序,group by 分组查询、having 只能用于group by子句、作用于组内,having条件子句可以直接跟函数表达式。使用group by 子句的查询语句需要使用聚合函数。


基础编程
