ASP中SQL语法注意事项
WHERE语句中如果要注意字段在数据库中定义的类型,字符型要加'',整型则不要加
EX:Set rsUser=conn.Execute("SELECT * FROM users WHERE id ='" & userid & "'")
EX:conn.Execute("SELECT * FROM users WHERE id =1")
EX:Set rsUser=conn.Execute("SELECT * FROM users WHERE id ='" & userid & "'")
EX:conn.Execute("SELECT * FROM users WHERE id =1")
从表中选出某属性值最大的一条记录:
orderid=conn.Execute("SELECT max(orderid) as ID FROM orders").Fields("ID").value
orderid=conn.Execute("SELECT max(orderid) as ID FROM orders").Fields("ID").value