求助 asp数据库 查询语句

来源:百度知道 编辑:UC知道 时间:2024/04/27 22:37:27
我想查询数据库里的 a表的 b字段和c字段中内容为1的数据
asp怎么些 高手指点下小弟
id=request.querystring("id")
sql="select * from a where b="&id and c="&id
错在哪?

如果二个都要为1就用and
select * from a where c=1 and b=1
如果只需要其中一个为1 就用or
select * from a where c=1 or b=1

有空到我空间看下 我想会有你需要的东西
http://hi.baidu.com/bludger