搜索

首页  >  问答  >  正文

mysql - 这个SQL是函数还是触发器还是存储过程?

set @num := 0, @type := '';

select type, variety, price,

  @num := if(@type = type, @num + 1, 1) as row_number,
  @type := type as dummy

from fruits
group by type, price, variety
having row_number <= 2;

怪我咯怪我咯2768 天前326

全部回复(0)我来回复

暂无回复
  • 取消回复