Insert Into 数据表名称(字段名称1,字段名称2,
) values(字段值1,字段值2,
) insert into user(username,password,age) values('李老四','6666',45) Update 数据表名称 Set 字段名称=字段值,字段名称=字段值,
[Where 条件] Delete From 数据表 下列查询返回在LONDON(伦敦)或SEATTLE(西雅图)的所有雇员: SELECT * FROM employees WHERE UPPER(city) IN ('LONDON', 'SEATTLE') 下面示例利用DATEDIFF 函数,确定在 pubs 数据库中标题发布日期和当前日期间的天数
SELECT DATEDIFF(day, OrderDate, getdate()) AS no_of_days FROM table1 返回字符串"wonderful"在 titles 表的 notes 列中开始的位置
SELECT CHARINDEX('wonderful', notes) 以下是返回的结果:(第47 个字符位置) 显示工作站的名称:select host_name() as [Client Computer Name] 下例是检索 titles 表中百分之五十的书
如果 titles 表中包含了 18 行,则将检索前 9 行
SELECT TOP 50 PERCENT title FROM titles 字段名称 [Not] Between 起始值 and 终止值 列出BOOK 表中30 至 50 元的书 select * from book where price between 30