怎样用SQL查询ACC数据库中的是/否字段

来源:百度知道 编辑:UC知道 时间:2024/03/28 22:31:25
比如acc数据库(date)中有个字段,字段名"good",字段数据类型"是/否"

现在在ASP中用SQL把字段数据类型是“是”的前十个数据找出来该怎样写?

我这样对吗?
sql="select * from date top 10 where good="是"

对吗?

如果随机选取1条又该怎么写呢?

sql="select top 10 * from date where good='是' order by ID asc"
"order by ID asc"里的ID是date表里唯一码字段,
不然会把所有的good="是"的记录都查询出来

sql="select top 10 * from date where good='是' order by ID asc"
Randomize
a=int(rand()*10)
rs.open sql,conn,1,3
rs.move a,0
这样就得到随机记录了

sql="select top 10 * from date where good=true 随机一条?
为啥要随机一条呢?

select top 1 * from date where good=1 order by rnd(1234)