sql server 内存表
--1加内存表
EXEC sp_tableoption '表名','pintable', 'true'
--2卸载内存表
EXEC sp_tableoption '表名','pintable', 'false'
--2查询是否有内存表驻留
SELECT * from INFORMATION_SCHEMA.Tables
WHERE TABLE_TYPE = 'BASE TABLE'
AND OBJECTPROPERTY(object_id(TABLE_NAME), 'TableIsPinned') > 0
相关文档:
功能:pl plus执行本地的sql文件中的sql语句
说明:比如:e:\zhaozhenlong下有create_table.sql文件,则按如下方法执行:
步骤:
1、在pl plus的 window下,
2、执行:
@e:\zhaozhenlong\drop_table.sql
@e:\zhaozhenlong\create_table.sql
......
select *
from (select row_number() over(partition by t.type order by date desc) rn,
t.*
from 表名 t)
where rn <= 2;
type要分的类
date 排序 ......
1. 当前系统日期、时间
select getdate()
2. dateadd 在向指定日期加上一段时间的基础上,返回新的 datetime 值
例如:向日期加上2天
&nbs ......
1. select replace(CA_SPELL,' ','') from hy_city_area 去除列中的所有空格
2. LTRIM() 函数把字符串头部的空格去掉
3. RTRIM() 函数把字符串尾部的空格去掉
4. select LOWER(replace(CA_SPELL,' ','')) f ......
第十一题:
有表students(name,class,grade),请用标准sql语句完成
name class grade
张三 数学 81
李四 语文 70
王五 数学 90
张三 语文 60
李四 数学 100
王五 语文 90
王五 英语 81
要求: 用sql语句输出各门功课都大于80分的同学姓名?
create table students (
name varchar(25),
class varchar(25),
grad ......