
MySQL
~
菜得只能自己玩泥巴
这个作者很懒,什么都没留下…
展开
-
mysql中的if,case when then else
学习原创 2021-04-16 16:55:08 · 318 阅读 · 0 评论 -
mysql dateDiff返回日期差
学习原创 2021-04-16 16:20:30 · 213 阅读 · 0 评论 -
mysql 中间表必须指定别名Every derived table must have its own alias
delete from Person where Id not in (select * from (select Min(Id) from Person Group by Email))这样写报错:Every derived table must have its own alias错误原因:中间表必须指定别名正确写法delete from Person where Id not in (select * from (select Min(Id) from Person Group by Ema原创 2021-04-16 15:31:50 · 251 阅读 · 0 评论 -
mysql 不能以select记录作为update或者delete条件
问题:错误写法:delete from Person where Id not in (select Min(Id) from Person Group by Email)错误原因:在MYSQL中,不能先Select一个表的记录,再按此条件Update和Delete同一个表的记录,否则会出错:You can’t specify target table ‘xxx’ for update in FROM clause.解决办法:用嵌套Select——将Select得到的查询结果作为中间表,再Se原创 2021-04-16 15:29:52 · 536 阅读 · 0 评论 -
mysql group by分组
学习原创 2021-04-16 15:07:21 · 123 阅读 · 0 评论 -
mysql limit分页查询
学习原创 2021-04-16 11:23:49 · 133 阅读 · 0 评论 -
Mysql将一次查询的结果作为一个表再次进行查询
学习别人的原创 2021-04-15 18:50:28 · 1799 阅读 · 0 评论 -
mysql8.xxx修改root密码
mysql8.xxx修改root密码转载 2021-03-08 18:59:15 · 95 阅读 · 0 评论 -
关于数据库属性文件db.properties文件属性为username(或者user)时得不到值问题
<context:property-placeholder location=“db.properties” system-properties-mode=“FALLBACK”/>FALLBACK — 默认值,不存在时覆盖NEVER — 不覆盖转载 2021-02-05 23:00:22 · 433 阅读 · 0 评论 -
Mac OS zsh: command not found: mysql解决方案
标准答案转载 2021-02-05 22:35:44 · 1124 阅读 · 1 评论 -
对表和数据库的操作
建表creat table约束(constraints)insert into创建数据库dropalter索引建表creat tablecreate table tab1( 列1 type 约束; id int primary key; 列2 type 约束; name varchar(255) unique; 列3 type 约束; age int Not null; …… foreign key(name) references tab2(name); unique(name,a.原创 2020-07-07 20:54:25 · 329 阅读 · 0 评论 -
SQL语句-更新与连接
插入更新删除记录插入insert into:向表中插入新纪录一次性对全部列插入一行:insert into tablename values(value1,value2,value3,……);一次对部分列插入一行insert into tablename (列1,列2,列3,……) values (value1, value2, value3,……);一次性插入多行insert into tablename values(……),(……);insert into tablename .原创 2020-07-07 11:30:13 · 1076 阅读 · 0 评论 -
SQL语句-查询
查询Select简单查询条件选择where比较条件和逻辑条件:字符串运算符的优先级:特殊条件:**判空****区间**in模糊查询like排序order by别名 as查询Select简单查询查询所有列:select * from tablename;查询指定列:select 列名1,列名2,…… from tablename;去重,返回唯一不同的值,若有多列,只要不全同皆返回select distinct 列…… from tablename;条件选择whereselect .原创 2020-07-06 21:39:04 · 538 阅读 · 0 评论 -
Mysql-常用命令
————————————————版权声明:本文为优快云博主「一只IT小小鸟」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。原文链接:https://blog.youkuaiyun.com/qq_34777600/article/details/81178891 **查看服务器mysql服务有没有开启:****登录到MySQL:**一 查看数据库、表、数据字段、数据查看当前所有的数据库:**选择(进入) 数据库:****查看当前数据库所有的表:****查看 某个表的字段结构 :转载 2020-07-05 21:36:44 · 429 阅读 · 0 评论