返回首页

我有一个表名"EMP"。我想从表中提取数据,其中curr_date是今天的日期和标志是"ABAN"。如何在一个查询中写两个条件呢?

回答

评论会员:拉杰什Anuhya 时间:2012/02/07
看这个例子
]:乌玛・尚卡尔帕特尔
评论会员:游客 时间:2012/02/07
希望你要做到这一点codeprelang="SQL"spanclass="code-keyword"select/spanname,codespanclass="code-keyword"from/spanempspanclass="code-keyword"where/spancurr_date=getdate()spanclass="code-keyword"and/spansign=spanclass="code-string"'/spanspanclass="code-string"ABAN'/span/pre/code
member60
评论会员:游客 时间:2012/02/07
U应该学会解决这些简单的事情,顺其自然。参考以下,可以帮助你{A}]
米卡Wendelius:如果你想搜索的数据为当前日期我走,你不感兴趣的时间部分。如果在数据库中的字段包含时间,你可以使用类似:
select  ...

from yourtable

where convert(date, curr_date) = convert(date, getdate())

and sign = 'ABAN'
评论会员:Monjurul哈比卜 时间:2012/02/07
我的问题不提供您的表字段的名称,你仍然可以尝试以下的概念: