Sql命令miss第一个要选择的元素 [英] Sql command miss first element to select
本文介绍了Sql命令miss第一个要选择的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下SQL select命令选择某行,
I am using the following SQL select command to select some row,
cmd = new SqlCommand("SELECT question FROM examQuestionWritten WHERE tchId = '" + getTchId + "' and session = '" + getSession + "' and dept = '" + getDept + "' and subject = '" + getSubject + "' and quizNum = '" + getQuizNum + "' ORDER BY questionNum ASC ", vcon);
工作正常很好,但它无法选择它应该是的第一个元素。例如,如果要选择4行,则始终忽略第1行并选择另一行(2,3行和第4行)。我不知道是什么问题,请帮帮我。
It work fine but it fails to select the first element that it should be. Example, if it have 4 row to select, it always ignore 1st row and select the other (2,3 and 4th row). I don't know what is the problem, please help me.
推荐答案
我觉得条件不满意.Plz正确检查代码。
i think condition is not satisfying.Plz check the code properly.
您好,
在您的查询中,您使用AND运算符作为条件。当所有条件基于此满足时,它将撤消数据。
注:
检查数值中的空格。
Hi,
In your query you are using AND operator for condition. When all condition meets based on this it will retieve data.
Note :
Check for empty space in your values.
这篇关于Sql命令miss第一个要选择的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文