爱情精算师墨舞碧歌:与和或的问题

来源:百度文库 编辑:高考问答 时间:2024/04/29 09:26:25
在ASP中,当a=1,并且b=2或者c=2或者d=2怎么写?
select 数据 from 表 where a=1 and b=2 or c=2 or d=2

select 数据 from 表 where b=2 or c=2 or d=2 and a=1
都不行啊
sql="select t_site.*,Agentinfo.agentName from t_site left join agentinfo on (t_site.agentId=agentInfo.Agentid) where (agentInfo.AgentID in (Select AgentID from Agentinfo where ChannelManagerID="&session("adminID")&") and (uid like '%"&request("UidInput")&"%' )or SiteTitle like '%"&request("UidInput")&"%' or UserType like '%"&request("UidInput")&"%' or agentname like '%"&request("UidInput")&"%') order by t_site.SiteID desc"

(d=2 and a=1)or...
也不行

a=1 and (b=2 or c=2 or d=2)
也不行

a=1 and (b=2 or c=2 orc d=2)

(d=2 and a=1)or...