日期:2014-05-18  浏览次数:21091 次

C# 查询数据库语句where怎么写
是这样的,我的条件查询 where TYPE == 2 || TYPE == 3
 "select * from UDS_MESSAGE where TOUSERNAME like @user order by TIME DESC";
怎么把上面的条件写到这个语句里面?

------解决方案--------------------
where (TYPE == 2 or TYPE == 3) and TOUSERNAME
------解决方案--------------------
或者
select * from UDS_MESSAGE where TYPE in (2,3) and TOUSERNAME like @user order by TIME DESC
------解决方案--------------------
select * from UDS_MESSAGE where TOUSERNAME like @user and ( TYPE = 2 or TYPE = 3)order by TIME DESC