Insert:
SET IDENTITY_INSERT dbo.orderlist ON
insert into dbo.orderlist (orderID,supplierNum,staffNum,orderNum,orderTime,money)
values(25,'s2','zg9','or25','2021-11-11',9999)
SET IDENTITY_INSERT dbo.orderlist OFF
Update:
update dbo.orderlist
set staffNum='zg18',money=10000
where orderID=25
Delete:
delete from dbo.orderlist
where orderID=25
Between:
select *
from orderlist
where money not between 10000 and 20000
SQL中 between and 是包括边界值的,not between不包括边界值,不过如果使用between and 限定日期需要注意,如果and后的日期是到天的,那么默认为00:00:00 例如:and 后的日期为2018年09月28日,就等价于2018-09-28 00:00:00 ,那么2018-09-28 11:24:54.000的数据就查不到了,如果要查到2018-09-28这一整天的数据,那么在取值的时候需要加1天,即BETWEEN '2018-06-28' AND '2018-09-29',这样返回的就是6月28日(含)到9月28日(含)的所有数据了
View-视图:可以当作表来使用
create view view_name AS
select column_name(s)
from table_name
where condition