与点击上方SQL数据库开发,关注获取SQL视频教程
SQL专栏

SELECT s1.Sname AS Sname1,s2.Sname AS Sname2FROM Student s2,Student s1


SELECT s1.Sname AS Sname1,s2.Sname AS Sname2FROM Student s2,Student s1WHERE s1.Sname=s2.Sname

SELECT s1.Sname AS Sname1,s2.Sname AS Sname2FROM Student s2,Student s1WHERE s1.Sname<>s2.Sname

SELECT s1.Sname AS Sname1,s2.Sname AS Sname2FROM Student s2,Student s1WHERE s1.Sname>s2.Sname


SELECT IDENTITY(INT) ID,Sname,ScoreINTO Student_TmpFROM Student

DELETE FROM Student_TmpWHERE Student_Tmp.ID< ( SELECT Max(s2.ID) FROM Student_Tmp s2 WHERE Student_Tmp.Sname=s2.Sname AND Student_Tmp.Score=s2.Score);

SELECT DISTINCT * INTO Student_Tmp FROM StudentTRUNCATE TABLE StudentINSERT INTO Student SELECT * FROM Student_TmpDROP TABLE Student_Tmp
——End—— 后台回复关键字:1024,获取一份精心整理的技术干货 后台回复关键字:进群,带你进入高手如云的交流群。 推荐阅读
再见!程序员!!! 一成人网站泄露 108 亿数据,50 逾万中国用户信息被曝光... SQL 查询优化之 WHERE 和 LIMIT 使用索引的奥秘 MySQL主从复制配置详解 神奇的 SQL,GROUP BY 真扎心,原来是这样!
这是一个能学到技术的公众号,欢迎关注
点击「阅读原文」了解SQL训练营最后修改时间:2020-05-15 08:15:18
文章转载自SQL数据库开发,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




