title: Sort Rows By keeping rows with specific values first in TSQL
body: <p>I've a query that lists up the work schedules for all days in a week and time with half hour increments. </p>
  
  <pre><code>SELECT ID,    
   CallCenterScheduleID As WorkScheduleID,    
   C.DayOfWeekID,    
   C.TimeOfDayID,   
   T.DisplayValue TimeDisplayName,  
   W.DayOfWeekName WeekDisplayName
  
  FROM tblCallCenterCapacityDetail C  
  
  INNER JOIN tblWeekDay W  
  ON C.DayOfWeekID = W.DayOfWeekID  
  
  INNER JOIN tblTimeOfDay T  
  ON C.TimeOfDayID = T.TimeOfDayID  
  
  WHERE CallCenterScheduleID = 75
  
  ORDER BY
      CASE 
          WHEN C.DayOfWeekID = 6 AND T.DisplayValue = '2:30 PM' THEN 0
          ELSE 1
      END ASC
  </code></pre>
  
  <p>Above query presents this result</p>
  
  <p><img src="https://i.stack.imgur.com/Hmc1Y.png" alt="enter image description here"></p>
  
  <p>Required:</p>
  
  <ol>
  <li><p>WeekDisplayName has 48 records for each day, like you see for Wednesday, you see first 19 records first, and rest of records appear at the end of result. I need to place all 48 records of a day together, and then 48 records for each succeeding day later on.</p></li>
  <li><p>After Wednesday, Thursday's first record has time 12:00AM, I need to show the same time as it was selected for Wednesay. As you can see, Wednesday first record shown has time on 2:30 PM, but Row # 20 which relates to Thursday shows 12:00AM first. 
  I need to show time of 2:30PM for each of day in week.</p></li>
  </ol>