应用场景sql

剔除之前冗余的数据
无标题.png
DELETE FROM Student WHERE Student.id NOT IN (SELECT *FROM((SELECT MAX(b.`id`) FROM Student b GROUP BY b.`Sname`,b.`Sid`,b.`Sage`,b.`Ssex` ))a)

找出名字中a三个及以上

select name from table where len(name)-len(replace(name,'a',''))>3

你可能感兴趣的:(应用场景sql)