上一页 1 2 3 4 5 6 7 8 ··· 12 下一页
摘要: inline 函数避免函数调用的开销 定义并使用一个inline函数 1 #include <iostream> 2 using namespace std; 3 inline const string& longer(const string &s1, const string &s2) 4 { 阅读全文
posted @ 2020-06-23 22:23 幻想Elapse 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 1 select * from scores 使用TOP限制结果集,WITH TIES作用-包括最后一行取值并列的结果 1 --查询english最高的前3名 2 select top 3 with ties id,chinese,math,english 3 from scores 4 order 阅读全文
posted @ 2020-06-23 21:50 幻想Elapse 阅读(527) 评论(0) 推荐(0) 编辑
摘要: 输出目录:$(SolutionDir)/bin/$(Platform)/$(Configuration) 中间目录:$(SolutionDir)/temp/$(Platform)/$(Configuration)/$(ProjectName) 效果:分别放到了一个文件夹中 阅读全文
posted @ 2020-06-23 18:48 幻想Elapse 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 对视图创建唯一索引后,视图的结果集将存储在数据库中,就像带有聚集索引的表一样。建有唯一聚集索引的视图称为索引视图,也称为物化视图 定义视图 select * from c select * from d 1 --定义视图 2 create view dbo.vc 3 with schemabindi 阅读全文
posted @ 2020-06-22 23:25 幻想Elapse 阅读(751) 评论(0) 推荐(0) 编辑
摘要: 函数声明由函数返回类型、 函数名和形参列表组成。 形参列表必须包括形参类型,但是不必对形参命名。 这三个元素被称为函数原型, 函数原型描述了函数的接口。 1 #include <iostream> 2 using namespace std; 3 double func(double a = 555 阅读全文
posted @ 2020-06-22 22:02 幻想Elapse 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 求最大公约数: 1 #include <iostream> 2 using namespace std; 3 // recursive version greatest common divisor program 4 int rgcd(int v1, int v2) 5 { 6 if (v2 != 阅读全文
posted @ 2020-06-22 18:30 幻想Elapse 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 一般情况下,返回类型是 void 的函数使用 return 语句是为了引起函数的强制结束,这种 return 的用法类似于循环结构中的 break 语句(第 6.10 节)的作用 1 //cstdlib 头文件定义了两个预处理变量,分别用于表示程序运行成功和失败: 2 #include <cstdl 阅读全文
posted @ 2020-06-22 18:04 幻想Elapse 阅读(1562) 评论(0) 推荐(0) 编辑
摘要: 类似于局部变量,函数的形参为函数提供了已命名的局部存储空间 函数不能返回另一个函数或者内置数组类型,但可以返回指向函数的指针,或指向数组元素的指针的指针 每次调用函数时,都会重新创建该函数所有的形参,此时所传递的实参将会初始化对应的形参。形参的初始化与变量的初始化一样:如果形参具有非引用类型,则复制 阅读全文
posted @ 2020-06-21 19:26 幻想Elapse 阅读(135) 评论(0) 推荐(0) 编辑
摘要: UNIQUE:唯一索引 CLUSTERED:聚集索引 NONCLUSTERED:非聚集索引 1 use Sales 2 create table goods 3 ( 4 id int, 5 name char(20), 6 price float 7 ) 8 create index id_inde 阅读全文
posted @ 2020-06-21 15:59 幻想Elapse 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 分区函数:告诉数据库管理系统以什么方式对表进行分区分区方案:将分区函数生成的分区映射到文件组中使用分区方案创建表 创建分区函数(作用域仅限于创建该分区函数的数据库) 在int列上创建左侧分区函数默认LEFT左侧分区 1 create partition function part1(int) 2 a 阅读全文
posted @ 2020-06-21 13:37 幻想Elapse 阅读(184) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 12 下一页