![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MYSQL
小猴子3000
啊花和大蕉
展开
-
MYSQL SQL级别动态拼接SQL语句
MYSQL 动态SQL语句最近在公司遇到一个业务需求,该需求大概是这样子的,查询表中最热门的数据。排序规则是根据转发量,推荐量,点赞量排序,并拿去第一条数据。如果表中的所有数据的转发量都为0的情况下则用推荐量排序,也就是说三个中选一个排序并获取第一条数据。排序的优先级分别为 转发量>推荐量>点赞量。首先为了模拟需求,我们将来建立一张话题表-- ------------------...原创 2019-12-24 00:05:09 · 2573 阅读 · 1 评论 -
Spring Boot MySQL数据库连接
Spring Boot 连接 MySQL数据库连接ONE. 导入MySQL依赖 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <sco...原创 2019-06-02 00:14:20 · 132 阅读 · 0 评论 -
java.sql.SQLException: The server time zone value '�й���ʱ��'
Spring Boot连接MySQL数据库常见问题ONE. 时区问题java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC dr...原创 2019-06-02 00:41:30 · 4815 阅读 · 0 评论 -
力扣数据库 - 181.超过经理收入的员工
SQL架构Create table If Not Exists Employee (Id int, Name varchar(255), Salary int, ManagerId int)Truncate table Employeeinsert into Employee (Id, Name, Salary, ManagerId) values ('1', 'Joe', '70000',...原创 2019-08-30 15:09:35 · 139 阅读 · 0 评论 -
力扣数据库 - 182.查找重复的电子邮箱
SQL架构Create table If Not Exists Person (Id int, Email varchar(255))Truncate table Personinsert into Person (Id, Email) values ('1', 'a@b.com')insert into Person (Id, Email) values ('2', 'c@d.com')...原创 2019-08-30 15:30:38 · 317 阅读 · 0 评论 -
力扣数据库 - 183.从不订购的客户
SQL架构Create table If Not Exists Customers (Id int, Name varchar(255))Create table If Not Exists Orders (Id int, CustomerId int)Truncate table Customersinsert into Customers (Id, Name) values ('1',...原创 2019-08-30 15:57:40 · 188 阅读 · 0 评论 -
力扣数据库 - 176.第二高的薪水
SQL架构Create table If Not Exists Employee (Id int, Salary int)Truncate table Employeeinsert into Employee (Id, Salary) values ('1', '100')insert into Employee (Id, Salary) values ('2', '200')inser...原创 2019-08-31 17:12:38 · 194 阅读 · 0 评论