Friday, January 8, 2016

Sort 2 columns at once SQL table using sub-query

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

Group by Phase
Order by Sequence

No comments:

Post a Comment

Adjustable DC to DC step up voltage booster using LM2577 -Adj P+ chip

One simple circuit to step up voltage using LM2577 -Adj P+ chip. The schematic is from Texas Instrument and it works expected - and below is...