自用模板sql
发表于|更新于
|浏览量:
真正的伟人,能在愚昧和喧嚣的物质世界中,静心倾听荒漠的声音。——深泉学院(美国)
自用sql,我建站时每张表必备如下字段:
1 | DROP TABLE IF EXISTS `common_template`; |
相关推荐
2020-12-27
mysql日期函数
不怨天,不尤人。——《论语》 转,原文 一、MySQL 获得当前日期时间 函数1,获得当前日期+时间(date + time)函数:now(): 12select now(); 结果:2008-08-08 22:20:46 2,获得当前日期+时间(date + time)函数:sysdate()sysdate() 日期时间函数跟 now() 类似,不同之处在于:now() 在执行开始时值就得到了, sysdate() 在函数执行时动态得到值; 12select sysdate(); 结果:2008-08-08 22:20:46 3,MySQL 获得当前时间戳函数:current_timestamp, current_timestamp(): 12select current_timestamp, current_timestamp(); 结果:2008-08-09 23:22:24 , 2008-08-09 23:22:24 二、MySQL 日期转换函数、时间转换函数1,MySQL Date/Time to Str(日期/时间转换为字符串)函数:da...
2024-06-10
ClickHouse快速入门
幻想中有比显示更高的东西,现实中也有比幻想更高的东西,把两者结合起来是最完美的。——列夫·托尔斯泰 官网: https://clickhouse.com/ 中文文档: https://clickhouse.com/docs/zh 我们执行命令运行 1curl https://clickhouse.com/ | sh 可以看到非常方便就好了 1234567891011121314151617181920212223Last login: Tue Jun 4 22:23:34 on ttys001curl https://clickhouse.com/ | shThe default interactive shell is now zsh.To update your account to use zsh, please run `chsh -s /bin/zsh`.For more details, please visit https://support.apple.com/kb/HT208050.GithubIireAchao:blog achao$ curl htt...
2022-09-25
GraphQL
可怕的不是外貌的丑陋,而是无法与人亲近的内心空虚——科恩 官网:https://graphql.org/ graphql是一个API的查询语言,可以理解为一个规范 正如它官方文档宣传的那样: 定义你的数据规范(数据类型) Describe your data12345type Project { name: String tagline: String contributors: [User]} 描述你想干什么(查询) Ask for what you want12345{ project(name: "GraphQL") { tagline }} 获得预期结果(只获得你需要的结果) Get predictable results12345{ "project": { "tagline": "A query language for APIs" }} 它有多种语言的库...
2022-02-10
mysql数据库信息函数
我将仇恨写在冰上,然后期待太阳的升起。——加西亚马尔克斯 打开mysql官方文档:Information Functions 可以看到mysql查询库表信息的函数 Name Description BENCHMARK() Repeatedly execute an expression CHARSET() Return the character set of the argument COERCIBILITY() Return the collation coercibility value of the string argument COLLATION() Return the collation of the string argument CONNECTION_ID() Return the connection ID (thread ID) for the connection CURRENT_ROLE() Return the current active roles CURRENT_USER(), CURRENT_USER...
2020-06-19
mysql使用druid时自动断开连接解决方案
今天接手了一个上了年龄的项目,用的是smm,数据库连接池用的druid,数据库版本较老,是5.0的mysql,我升级成mysql8.0后,一开始还没问题,然后大概每次无连接2分钟后数据库自动断开。。。 前端妹子立马跟我说接口报错了,我咯噔心里一慌,让前端妹子给我截一下报错信息(后台日志刷的太多,当时没注意到)。然后前端妹子说,哦又好了,我当时意识到不对劲,但也没有深究,直到这样的问题出了几次,每次一刷新又好了,我开始意识到问题的严重性。 一开始我复制了报错信息,也就是这一段 123Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failureThe last packet successfully received from the server was 8848 milliseconds ago. The last packet sent successfully to the server was 8848 milliseconds ago. 搜了半天,网上...
2023-02-16
mysql having报错this is incompatible with sql_mode=only_full_group_by
该得到荣誉却未得到,比不该得到荣誉而得到要好得多。——马克·吐温 今天遇到个报错 发现原来是MYSQL 8不支持在sql_mode包含only_full_group_by时(默认包含) HAVING的条件里有 非聚合字段 以外的字段 文档: ONLY_FULL_GROUP_BY Reject queries for which the select list, HAVING condition, or ORDER BY list refer to nonaggregated columns that are neither named in the GROUP BY clause nor are functionally dependent on (uniquely determined by) GROUP BY columns. A MySQL extension to standard SQL permits references in the HAVING clause to aliased expressions in the select list. The ...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog