
mysql
tangerine_
这个作者很懒,什么都没留下…
展开
-
collate utf8_bin什么意思
创建数据库时collate utf8_bin是 以二进制值比较,也就是区分大小写,collate是核对的意思uft-8_general_ci 一般比较,不区分大小写原创 2018-12-13 15:15:19 · 10729 阅读 · 1 评论 -
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c
1、查看sql_modeselect @@sql_mode查询出来的值为:ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION2、去掉ONLY_FULL_GROUP...原创 2018-12-21 10:35:39 · 144 阅读 · 0 评论 -
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that c
1。ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')engine=InnoDBdefault character set=utf8 ...原创 2018-12-21 12:02:58 · 27504 阅读 · 0 评论 -
查询每个部门工资最高的员工
CREATE TABLE `employee` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id唯一标识 /注:自增', `name` varchar(50) DEFAULT NULL COMMENT '名称', `salary` int(11) DEFAULT NULL COMMENT '薪水', `departmentId`...原创 2019-01-07 13:54:22 · 5547 阅读 · 0 评论 -
join on 等价于where
1SELECT a.runoob_id, a.runoob_author, b.runoob_countFROM runoob_tbl a INNER JOIN tcount_tbl b ON a.runoob_author = b.runoob_author;2SELECT a.runoob_id, a.runoob_author, b.runoob_countFROM ru...原创 2019-01-07 14:52:34 · 524 阅读 · 1 评论 -
mysql45经典题
测试表格–1.学生表Student(S#,Sname,Sage,Ssex) –S# 学生编号,Sname 学生姓名,Sage 出生年月,Ssex 学生性别–2.课程表 Course(C#,Cname,T#) –C# –课程编号,Cname 课程名称,T# 教师编号–3.教师表 Teacher(T#,Tname) –T# 教师编号,Tname 教师姓名–4.成绩...转载 2019-01-07 15:13:34 · 728 阅读 · 0 评论 -
编写sql实现分数排名 mysql
编写一个 SQL 查询来实现分数排名。如果两个分数相同,则两个分数排名(Rank)相同。请注意,平分后的下一个名次应该是下一个连续的整数值。换句话说,名次之间不应该有“间隔”。+----+-------+| Id | Score |+----+-------+| 1 | 3.50 || 2 | 3.65 || 3 | 4.00 || 4 | 3.85 || 5 ...原创 2019-01-07 16:02:10 · 3543 阅读 · 0 评论 -
查询,实现分数排名,去重显示。
#创建成绩表CREATE TABLE `tscore` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id唯一标识 /注:自增', `score` float(11) DEFAULT NULL COMMENT '分数', PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ...原创 2019-01-08 10:54:18 · 948 阅读 · 0 评论 -
navivat输入sql语句 报错[Err] 1055 - Expression #1 of ORDER BY clause
1.错误信息:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in ...原创 2019-01-30 09:56:49 · 2637 阅读 · 0 评论