在ASP里面的一句SQL语句写法,请高手进!!

来源:百度知道 编辑:UC知道 时间:2024/06/15 00:51:52
我要用一句SQL语句查找出该表里面 user字段里面的名字为kk 并且 在yes字段里面为1
这样的SQL语句如何写?
表名为: bya
请高手指点.
还有.按照time字段里面的时间降序排列.

上面的回答都忽视了一个问题,那就是你的字段名yes和关键字有冲突,因而,正确的写法应是:
select * from bya where [user]='kk' and [yes]=1 order by time desc
以上语句,我试验过,没错的

select * from bya where user='kk' and yes=1 order by time desc

正确

select * from bya where user='kk' and yes=1 order by time desc

select * from 表名where user='kk' and yes=1