SQL
1.总起来就四个字CURD C=create U=update R=read D=delete
对应语句就是insert into | update | select | delete
2.注意防止sql injection
txtNam = getRequestString("CustomerName");
txtAdd = getRequestString("Address");
txtCit = getRequestString("City");
txtSQL = "INSERT INTO Customers (CustomerName,Address,City) Values(@0,@1,@2)";
db.Execute(txtSQL,txtNam,txtAdd,txtCit);
这方法叫做参数化sql语句,先建立一个sql语句的样式pattern,可变部分作为参数传入。
3.第一次了解了foreign key 的用法
select customers.customerid,orders.orderdate,customers.city,customer.country
from customers inner join orders on customers.customerid=orders.customerid where customers.city=‘london‘ and orders.orderid <77
inner 所得的结果是join
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。