数据库汇总(MySQL教材)

1、SQL重复记录查询的几种方法

https://www.cnblogs.com/firstdream/p/5826238.html

2、SQL两列字段,合并为一个字符串,中间加符号

https://zhidao.baidu.com/question/553447687.html

主要看两列是什么类型,一般就是数字或者字符,如果都是字符就直接用“+”连接即可,如果是数字的话,需要将数字转成字符再连接。

如,test表,这里id是数字类型

id   name

1     张三

2     李四

现在要将两列连接

1
select cast(id as varchar)+name as str from test;

得到的结果

str

1张三

2李四

如果id列为字符类型

1
select id+name as str from test;

结果同上

3、select 1 from table 含义

https://wl-ldy.iteye.com/blog/1170985

4、sql中exists,not exists的用法

https://www.cnblogs.com/cjm123/p/8177017.html

5、left join 后,左表怎样合并或者去掉重复记录

https://blog.csdn.net/txqd1989/article/details/53760860

6、MySQL sum()函数

https://www.yiibai.com/mysql/sum.html

7、Mysql字符串截取总结:left()、right()、substring()、substring_index()

https://www.cnblogs.com/heyonggang/p/8117754.html

8、CASE WHEN 及 SELECT CASE WHEN的用法

https://www.cnblogs.com/aipan/p/7770611.html

9、触发器相关语句

10、Mysql 如何备份与还原数据库(在Mysql Workbench)

原文地址:https://www.cnblogs.com/cheng2015/p/10678879.html