百兆网线最大传输速度:"select count(*) Mycount from books "

来源:百度文库 编辑:高考问答 时间:2024/04/28 14:44:00
"Mycount"为"count(*)"的别名,怎么会提示我出错呢?真糊涂了
还有在建立完连接,执行完查询语句后,我用
rs.close
conn.close
关闭这个记录集和连接,怎么一直提示我出错呢?说什么这种做法不客观

第一个 问题
select count(*) as mycount from books
第二个问题
<% if cint(count1)=cint(a) then %>

AS 子句可用来更改结果集列名或为导出列指定名称。
不是所有的数据库都支持AS的,楼主的语句在SQL Server中可以运行,不需要加as,但是别的数据库就不一定了.
还有bfbsoft说的不错,"内嵌式SQL语句"和直接在数据库中执行的不一样,比如:
select * from table where name like '%张三%'
但是如果放到access中直接执行就不可以,要换成:
select * from table where name like '#张三#'

select count(*) as Mycount from books
缺少"as"

select count(*) as Mycount
from books
我总觉得你的意思有错误,count(*)???
我想你要的是所有的书的数量,所以应该是count(ID)或者是其他的,用来标识书的序号的那个字段才对,好象不能象这样写:count(*).
还有在写的时候一定要注意格式.

第一个问题:
select count(*) as Mycount from books
第二个问题:
<%if Cint(coun1)=Cint(a) then%>

第一个问题:
select count(*) as Mycount from books
第二个问题:
<%if Cint(coun1)=Cint(a) then%>