title: SQL: need to sort the value using group by or any other way
body: <p>This is the example scenery of my table. First I have to find, order by ITime asc, BUT if there have any record those are same in ITime then the record order will be  “pass->fail->withdraw”. Please check the below temporary table.</p>
  
  <pre><code>if object_id('tempdb.dbo.#temp321','U') is not null
  drop table tempdb.dbo.#temp321
  create table #temp321(
  id int,
  uname varchar(50),
  ITime datetime,
  Result varchar(10)
  )
  INSERT into #temp321 values('1','a','2012-11-12 13:12:28.103','pass')
  INSERT into #temp321 values('2','b','2012-11-12 13:12:28.103','fail')
  INSERT into #temp321 values('3','c','2012-11-12 12:58:30.000','pass')
  INSERT into #temp321 values('4','d','2012-11-12 13:12:28.103','withdrow')
  INSERT into #temp321 values('5','e','2012-11-12 12:58:41.360','withdraw')
  INSERT into #temp321 values('6','f','2012-11-12 13:12:28.103','pass')
  INSERT into #temp321 values('7','g','2012-11-12 13:12:28.103','fail')
  select ID from #temp321 ORDER BY ITime ASC
  drop table #temp321
  
  
  Expected outcomes ID value : 3,5,1,6,2,7,4
  </code></pre>
  
  <p>How i do it? thanks in advance.</p>