mysql select to return blanks for all but first row of repeating column

前端 未结 5 652
独厮守ぢ
独厮守ぢ 2020-12-21 14:17

Is it possible to create a mysql select (directly or using a stored procedure) that will return blanks for repeating columns. For example, a select that would normally retu

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-21 14:43

    For future readers, here is a select query that will return blanks for repeating column values.

    SELECT IF(name=@previous, "", @previous:=name) as name_, value
    FROM (SELECT @previous:= '') AS temp, tableName
    ORDER BY name
    

提交回复
热议问题