I have a table where the first column is an integer and second column is string. What i wanted is for the first column to sort by sequence first and then second column should group itself one after another when the value is the same. To simulate my idea please see below. Not sure if this even possible?
Sorting 2 columns
You see the correct order should be as below where the Seq is running in ascending order but when there is same phase it will pick list below it before moving to the next. So the sequence is arrange correctly and yet the grouping of phase also correct
[
This might be close to what you want:
SELECT t1.*
FROM PlanActual AS t1
INNER JOIN (
SELECT MIN(Seq) AS minSeq, Phase
FROM PlanActual
GROUP BY Phase
) AS t2 ON t1.Phase = t2.Phase
ORDER BY t2.minSeq