一次执行1个不同条件的查询 [英] Execution of 1 query with different condition at 1 time
本文介绍了一次执行1个不同条件的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的朋友们,
我对执行查询有疑问。
我希望显示2条不同的记录,其CTC高于2L且低于2L。
所以用<制作了2个不同的查询和>符号。
有没有办法获得一次执行的记录,例如一次用不同的符号执行查询。
请指导我。
Dear Friends,
I have doubt in executing a query.
I want display 2 different records whose CTC is above 2L and below 2L.
So have crafted 2 different query with < and > symbol.
Is there any way to get a record on one time execution, such as executing the query at 1 time with different symbol.
Kindly guide me on this.
Select * from CTC_Table with (Nolock) where CTC<200000
Select * from CTC_Table with (Nolock) where CTC>200000
推荐答案
Select * from CTC_Table where CTC < 200000 or CTC > 200000;
将会这样做
在这个特定的例子中,你也可以使用
will do it
in this particular instance, you could also use
Select * from CTC_Table where CTC <> 200000;
这篇关于一次执行1个不同条件的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文