Skip to main content
7 events
when toggle format what by license comment
Jul 4, 2023 at 9:58 comment added naviram As I see it, use @Kelvin solution if you need it readable, or use Mikael's solution if you need it performant. I wonder what everyone thinks.
Jan 17, 2023 at 2:56 comment added Jeff Moden Since he posted that before the first answer was posted, I'm curious then, why folks posted solutions that could actually hurt the OP.
Jan 16, 2023 at 6:38 comment added Mikael Eriksson @JeffModen yes, that is true. Without a reliable order you could get either value as "last" as Ypercube pointed that out in a comment to the question.
Jan 16, 2023 at 1:35 comment added Jeff Moden It breaks if either of the two Val columns for Q3 are both not null. I wouldn't rely on this unless there's another column in the table that the OP hasn't posted that does preserve the order. The basic method is outstanding but there must be something that reliably and uniquely enforces the order.
Sep 17, 2018 at 14:31 vote accept Edmund
Jun 7, 2018 at 7:08 history edited Mikael Eriksson CC BY-SA 4.0
added 277 characters in body
Jun 7, 2018 at 6:59 history answered Mikael Eriksson CC BY-SA 4.0