随笔分类 -  数据库

上一页 1 ··· 4 5 6 7 8 9 10 11 下一页
摘要:order by travelled_distance desc, name asc 阅读全文
posted @ 2022-12-04 22:11 yinghualeihenmei 阅读(108) 评论(0) 推荐(0) 编辑
摘要:之前会纠结,12月份有没有31号这样,直接用小于下一年的1月1号就可以了!!! 条件中where time>'2020-01-01' AND time <'2021-01-01' year(b.order_date) = '2020' 这样写也可以!!! 阅读全文
posted @ 2022-12-04 21:43 yinghualeihenmei 阅读(51) 评论(0) 推荐(0) 编辑
摘要:https://leetcode.cn/problems/game-play-analysis-i/submissions/ Activity 表:+ + + + +| player_id | device_id | event_date | games_played |+ + + + +| 1 | 阅读全文
posted @ 2022-12-04 21:33 yinghualeihenmei 阅读(52) 评论(0) 推荐(0) 编辑
摘要:SQL——EXISTS用法 原文链接:http://www.manongjc.com/detail/26-vnlqolqounrrkqi.html 如下:表AID NAME 1 A12 A23 A3表BID AID NAME1 1 B12 2 B2 3 2 B3表A和表B是1对多的关系 A.ID = 阅读全文
posted @ 2022-12-04 17:08 yinghualeihenmei 阅读(160) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/shuilangyizu/p/6296440.html DATEDIFF 函数 [日期和时间] 功能 返回两个日期之间的间隔。 语法 DATEDIFF ( date-part, date-expression-1, date-expression-2 阅读全文
posted @ 2022-12-04 00:20 yinghualeihenmei 阅读(372) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/qq_51179608/article/details/124322292 实际上,每个web应用程序和数据库都扮演着重要的角色。由于当前web开发的动态特性,即使是最基本的应用程序也需要某种存储、检索和修改数据的机制。自然,随着数据库的重要性的飙升,某些 阅读全文
posted @ 2022-12-03 22:06 yinghualeihenmei 阅读(893) 评论(0) 推荐(0) 编辑
摘要:要想获取第二高,需要排序,使用 order by(默认是升序 asc,即从小到大),若想降序则使用关键字 desc 去重,如果有多个相同的数据,使用关键字 distinct 去重 判断临界输出,如果不存在第二高的薪水,查询应返回 null,使用 ifNull(查询,null)方法 起别名,使用关键字 阅读全文
posted @ 2022-12-03 22:06 yinghualeihenmei 阅读(57) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/tswc_byy/article/details/81909822 二、having的用法1.解释:having子句是用来对分组之后的信息进行过滤,因此使用having时通常都会先使用group by。 select deptno,avg(sal) fro 阅读全文
posted @ 2022-12-03 21:35 yinghualeihenmei 阅读(1245) 评论(0) 推荐(0) 编辑
摘要:题目: https://leetcode.cn/problems/tree-node/ 给定一个表 tree,id 是树节点的编号, p_id 是它父节点的 id 。 + + +| id | p_id |+ + +| 1 | null || 2 | 1 || 3 | 1 || 4 | 2 || 5 阅读全文
posted @ 2022-12-03 21:00 yinghualeihenmei 阅读(47) 评论(0) 推荐(0) 编辑
摘要:https://mp.weixin.qq.com/s?src=11&timestamp=1670070823&ver=4204&signature=OpXckzt0JIEqamYo0WpJqwgtbQDMFkUpQ0Nc56WLqzHq0bMR91TRHbCxycSCx49JmQNO9K7MCZ-X 阅读全文
posted @ 2022-12-03 20:36 yinghualeihenmei 阅读(1547) 评论(0) 推荐(0) 编辑
摘要:文章来源:https://leetcode.cn/problems/rearrange-products-table/solution/by-esqiimulme-pjiy/ 列转行用union或union all将多列的字段整合到一行。(当使用union 时,mysql 会把结果集中重复的记录删掉 阅读全文
posted @ 2022-12-03 20:25 yinghualeihenmei 阅读(1894) 评论(0) 推荐(0) 编辑
摘要:文件来源: https://zhuanlan.zhihu.com/p/388914136 新建维护计划的时候遇到下图的报错信息 标题: Microsoft SQL Server Management Studio 处理方法:启动代理服务 阅读全文
posted @ 2022-12-01 18:32 yinghualeihenmei 阅读(162) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/CodeWu91/p/5621292.html windows server 2012 r2 里面安装 sql server 2008 r2 问题总结 前提是 windows server 2012 r2 已经安装完成 ,(仅仅是安装完成 啥服务都没配 阅读全文
posted @ 2022-11-29 17:37 yinghualeihenmei 阅读(1490) 评论(0) 推荐(0) 编辑
摘要:DIAB100 MYOP ACNE DIAB100 column like '% DIAB1%' or column like 'DIAB1%' '% DIAB1%'的前面有个空格,空格是分隔两个代码的格式 阅读全文
posted @ 2022-11-28 23:53 yinghualeihenmei 阅读(5) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/weixin_42176639/article/details/96457859 https://blog.csdn.net/m0_64401301/article/details/123212823 https://blog.csdn.net/m0_67 阅读全文
posted @ 2022-11-28 17:44 yinghualeihenmei 阅读(3770) 评论(0) 推荐(1) 编辑
摘要:将名字的第一位改为大写,其他位改为小写 CONCAT(UPPER(left(name, 1)), LOWER(RIGHT(name, length(name) - 1))) as name SQL Server中提供了一个concat()函数用于将两个字符串连接起来,形成一个单一的字符串。 sele 阅读全文
posted @ 2022-11-28 00:22 yinghualeihenmei 阅读(193) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/dnm49386/article/details/101730090 MIN() 函数 MIN 函数返回一列中的最小值。NULL 值不包括在计算中。 SQL MIN() 语法 SELECT MIN(column_name) FROM table_name 阅读全文
posted @ 2022-11-28 00:10 yinghualeihenmei 阅读(524) 评论(0) 推荐(0) 编辑
摘要:https://zhidao.baidu.com/question/619228487244788132.html 这个是sqlserver数据库中取余的方法 比如: 其中100是被除数,3是除数 2、mod(被除数,除数) 阅读全文
posted @ 2022-11-27 10:48 yinghualeihenmei 阅读(1126) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/qianxingdewoniu/p/6858580.html CHARINDEX作用 写SQL语句我们经常需要判断一个字符串中是否包含另一个字符串,但是SQL SERVER中并没有像C#提供了Contains函数,不过SQL SERVER中提供了一个叫 阅读全文
posted @ 2022-11-26 11:13 yinghualeihenmei 阅读(244) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/m0_67401382/article/details/126117592 常用的函数有cast()和convert()。 cast()和convert()函数比较:(1)cast一般更容易使用,convert的优点是可以格式化日期和数值; (2)conv 阅读全文
posted @ 2022-11-23 12:00 yinghualeihenmei 阅读(830) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 下一页
点击右上角即可分享
微信分享提示