convert

Leetcode 108. Convert Sorted Array to Binary Search Tree

别来无恙 提交于 2020-02-07 04:44:17
顺序数组建树,要从中间开始建树。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* sortedArrayToBST(vector<int>& nums) { return buildTree(nums, 0, nums.size() - 1); } TreeNode* buildTree(vector<int>& nums, int l, int r){ if(l > r) return NULL; int m = l + ((r - l) >> 1); TreeNode *t = new TreeNode(nums[m]); t->left = buildTree(nums, l, m - 1); t->right = buildTree(nums, m + 1, r); return t; } }; 来源: https://www.cnblogs.com/littlepage/p/12271803.html

SQL中CONVERT转化函数的用法

徘徊边缘 提交于 2020-02-04 18:10:40
格式: CONVERT(data_type,expression[,style]) 说明: 此样式一般在时间类型(datetime,smalldatetime)与字符串类型(nchar,nvarchar,char,varchar) 相互转换的时候才用到. 例子: SELECT CONVERT(varchar(30),getdate(),101) now 结果为: now --------------------------------------- |09/15/2001 =================================================================== style数字在转换时间时的含义如下: ------------------------------------------------------------------------------------------------------------ Style(2位表示年份) | Style(4位表示年份) | 输入输出格式 ------------------------------------------------------------------------------------------------------------ 0 | 100 | mon dd

SQL中CONVERT转化函数的用法

匆匆过客 提交于 2020-02-04 18:07:45
格式: CONVERT (data_type,expression [ ,style ] ) 说明: 此样式一般在时间类型( datetime , smalldatetime )与字符串类型( nchar , nvarchar , char , varchar ) 相互转换的时候才用到. 例子: SELECT CONVERT ( varchar ( 30 ), getdate (), 101 ) now 结果为: now -- ------------------------------------- | 09 / 15 / 2001 =================================================================== style数字在转换时间时的含义如下: -- ---------------------------------------------------------------------------------------------------------- Style(2位表示年份) | Style(4位表示年份) | 输入输出格式 -- -----------------------------------------------------------------------------------------

SQL中CONVERT转化函数的用法

六月ゝ 毕业季﹏ 提交于 2020-02-04 17:56:15
格式: CONVERT (data_type,expression [ ,style ] ) 说明: 此样式一般在时间类型( datetime , smalldatetime )与字符串类型( nchar , nvarchar , char , varchar ) 相互转换的时候才用到. 例子: SELECT CONVERT ( varchar ( 30 ), getdate (), 101 ) now 结果为: now -- ------------------------------------- | 09 / 15 / 2001 =================================================================== style数字在转换时间时的含义如下: -- ---------------------------------------------------------------------------------------------------------- Style(2位表示年份) | Style(4位表示年份) | 输入输出格式 -- -----------------------------------------------------------------------------------------

excel导入记录

独自空忆成欢 提交于 2020-02-01 03:38:04
use DangJian SELECT vale1, value2 into Table2 from Table1 select COUNT(*) from tmpdangyuan where 手机号 in (select phone from T_YEWU_User) select COUNT(1) from T_YEWU_User delete from tmpyexf where phone in (select phone from T_YEWU_User) --ELECT vale1, value2 into Table2 from Table1 insert into T_YEWU_User (Name , Phone,Password,Sex ,Type ,IsBind ,IsDelete ,IsTransfer,SystemID,Dues, Balance ,IsAdmin,[IsLeave],[AutoMoney] ,[Birthday],[JoinTime],[RegularTime]) select name, phone,'123456',1, 1,0 ,0 ,1 ,systemid ,0 ,0 ,0,0,0 ,'1947-08-23 00:00:00.000', '1967-07-01 00:00:00.000' , '1968-07-01 00:00

常见证书类型及相互转换

会有一股神秘感。 提交于 2020-01-31 03:39:49
What does a CSR look like? Most CSRs are created in the Base-64 encoded PEM format. This format includes the "-----BEGIN CERTIFICATE REQUEST-----" and "-----END CERTIFICATE REQUEST-----" lines at the begining and end of the CSR. A PEM format CSR can be opened in a text editor and looks like the following example: -----BEGIN CERTIFICATE REQUEST----- MIIByjCCATMCAQAwgYkxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh MRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRMwEQYDVQQKEwpHb29nbGUgSW5jMR8w HQYDVQQLExZJbmZvcm1hdGlvbiBUZWNobm9sb2d5MRcwFQYDVQQDEw53d3cuZ29v

sql 语句日期用法及函数

柔情痞子 提交于 2020-01-26 08:57:51
--DAY()、MONTH()、YEAR()——返回指定日期的天数、月数、年数; select day(cl_s_time) as '日' from class --返回天 select '月'=month(cl_s_time) from class --返回月 select '年'=year(cl_s_time) from class --返回年 --DATEADD(datepart,number,date)——在日期上增加给定日期类型的数量; select dateadd(yyyy,4,cl_s_time) as '增加4年后' from class --datepart - 年份 yy、yyyy select dateadd(q,2,cl_s_time) as '增加2季度后' from class --datepart - 季度 qq、q select dateadd(mm,3,cl_s_time) as '增加3月度后' from class --datepart - 月份 mm、m --datepart - 每年的某一日 dy、y --datepart - 日期 dd、d --datepart - 星期 wk、ww --datepart - 小时 hh --datepart - 分钟 mi、n --datepart - 秒 ss、s --datepart - 毫秒 ms

09 Convert Binary Number in a Linked List to Integer

爱⌒轻易说出口 提交于 2020-01-24 15:38:28
题目 Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the linked list. Example 1: Input: head = [1,0,1] Output: 5 Explanation: (101) in base 2 = (5) in base 10 Example 2: Input: head = [0] Output: 0 Example 3: Input: head = [1] Output: 1 Example 4: Input: head = [1,0,0,1,0,0,1,1,1,0,0,0,0,0,0] Output: 18880 Example 5: Input: head = [0,0] Output: 0 Constraints: The Linked List is not empty. Number of nodes will not exceed

jde日期转换

我的梦境 提交于 2020-01-24 04:18:14
select DATEADD(day,convert(int,substring(‘117064’,4,3))-1, convert(date,‘20’+substring(‘117064’,2,2)+’-01-01’)) 来源: CSDN 作者: sailbird 链接: https://blog.csdn.net/sailbird/article/details/103913181

12c以上的版本,对表进行在线分区(不使用在线重定义)

自作多情 提交于 2020-01-23 11:28:05
12c开始,对表进行在线分区,可以不使用在线重定义的方法。可以直接使用aleter table modify的方式进行分区。 参考文档: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/vldbg/evolve-nopartition-table.html#GUID-5FDB7D59-DD05-40E4-8AB4-AF82EA0D0FE5 测试环境 RDBMS 19.6.0.0 -- 创建测试用的表 SQL> create table employees_convert as select * from hr.employees; Table created. SQL> -- 对测试的表进行转换 (在sys下不支持这样做 ) ALTER TABLE employees_convert MODIFY PARTITION BY RANGE (employee_id) INTERVAL (100) ( PARTITION P1 VALUES LESS THAN (150), PARTITION P2 VALUES LESS THAN (200) ) ONLINE UPDATE INDEXES ( IDX1_SALARY LOCAL, IDX2_EMP_ID GLOBAL PARTITION BY RANGE