2021年10月27日
摘要: 语法: MERGE [ INTO ] <target_table> [ [ AS ] table_alias ] USING <table_source> [ [ AS ] table_alias ] ON <merge_search_condition> [ WHEN MATCHED [ AND 阅读全文
posted @ 2021-10-27 17:51 雯烈 阅读(69) 评论(0) 推荐(0) 编辑
  2021年10月22日
摘要: 1.首先创建临时表模拟数据 1 IF OBJECT_ID('tempdb.dbo.#Company') IS NOT NULL DROP TABLE #Company; 2 CREATE TABLE #Company 3 ( 4 CompanyID INT NOT NULL 5 PRIMARY KE 阅读全文
posted @ 2021-10-22 12:11 雯烈 阅读(199) 评论(0) 推荐(0) 编辑
  2021年10月21日
摘要: 直接上语句 1 IF OBJECT_ID('tempdb.dbo.#Contact') IS NOT NULL DROP TABLE #Contact; 2 CREATE TABLE #Contact 3 ( 4 EmployeeID INT NOT NULL, 5 PhoneNumber1 BIG 阅读全文
posted @ 2021-10-21 10:12 雯烈 阅读(771) 评论(0) 推荐(0) 编辑
  2020年10月31日
摘要: 1.开始我们想要这样一个类Sorter, 通过里面的Sort方法可以将一个int数组排序,这里我们用选择排序来实现 1 int[] arr = { 9, 2, 3, 5, 7, 1, 4 }; 2 3 Sorter sorter = new Sorter(); 4 5 sorter.Sort(arr 阅读全文
posted @ 2020-10-31 22:53 雯烈 阅读(111) 评论(0) 推荐(0) 编辑
  2020年10月17日
摘要: 体会轴的概念 先做一个方法,定义一个数组,以最后一个数为轴,把比轴小的数放在轴的左边,比轴大的数放在轴的右边 1 public static void LastAxleSort(int[]arr,int leftB,int rightB) 2 { 3 4 5 int left = leftB; 6 阅读全文
posted @ 2020-10-17 09:55 雯烈 阅读(130) 评论(0) 推荐(0) 编辑
  2020年10月14日
摘要: 1.递归的概念 1.首先写一个小方法,对2个已经排好顺序的数组进行归并排序 代码如下: 1 public static void MergeSortPart1() 2 { 3 int[] arr = { 1, 4, 7,8, 3, 6, 9 }; 4 var tempArr = new int[ar 阅读全文
posted @ 2020-10-14 22:13 雯烈 阅读(140) 评论(0) 推荐(0) 编辑
  2020年10月12日
摘要: 代码实现: 1 //希尔排序 2 public static void ShellSort(int[] arr) 3 { 4 5 for (int gap= arr.Length/2; gap>0; gap=gap/2) 6 { 7 for (int i = gap; i<arr.Length ; 阅读全文
posted @ 2020-10-12 14:29 雯烈 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 代码实现 1 //插入排序 2 public static void InsertSort(int[] arr) 3 { 4 5 for (int i = 1; i < arr.Length; i++) 6 { 7 for (int j = i; j > 0 ; j--) 8 { 9 if (arr 阅读全文
posted @ 2020-10-12 14:28 雯烈 阅读(155) 评论(0) 推荐(0) 编辑
  2020年2月7日
摘要: 1.原始查询 SELECT s.Name AS ShiftName, h.BusinessEntityID, d.Name AS DepartmentName FROM HumanResources.EmployeeDepartmentHistory h INNER JOIN HumanResour 阅读全文
posted @ 2020-02-07 15:05 雯烈 阅读(2320) 评论(1) 推荐(0) 编辑
  2020年2月2日
摘要: 多语句表值函数顾名思义是返回了一张表,可以传入多个参数 1.定义 1 Use AdventureWorks2014; 2 go 3 if exists(select * from sys.objects where name='udf_SEL_SalesQuota') 4 drop function 阅读全文
posted @ 2020-02-02 18:04 雯烈 阅读(1615) 评论(0) 推荐(0) 编辑