mysql 特殊用法

在mysql中类似oracle的rowid

SELECT @rowNum:=@rowNum + 1 AS '行号',a.* FROM constellation_keywords_info a,(SELECT @rowNum:=0) b;

mysql取分组前3条记录,(性能极差)

https://blog.csdn.net/Jacksun_huang/article/details/88869025

(性能极差)
select a.,count() as num from constellation_analysis_info as a
inner join constellation_analysis_info as b ON a.constellation_code=b.constellation_code
where b.id>=a.id group by a.id having num<=3

MySQL中利用简单SQL实现开窗函数的分组排序功能 (性能极好)
https://jingyan.baidu.com/article/d8072ac48d2730ec94cefd43.html?qq-pf-to=pcqq.c2c







你可能感兴趣的:(mysql 特殊用法)