=’2002-1-7’ (SQL Server)
提示:
日期函数to_date不是标准sql文,不是所有的数据库适用,所以大家在使用的时候要参考数据库具体语法
另外如果是
查询传入的变量,则如下:
strau=request.form("author")
strsql="select * from book where author=’"&;strau&;"’"
如果查询的是数字,则:
intID=request.form("id")
str
sql="select * from book where id="&;intID
在很多数据库中,如:oracle,上面的语句是可以写成:
strsql="select * from book where id='"&;intID&;"'"的。
但是字符型一定不能按照数字格式写,需要注意。
2.添加记录(Insert)
语法:Insert into table(field1,field2,....) Values (value1,value2,....)
例子:添加一作者是"cancer"的记录入book表:
insert into book (bookn