empty value cell if the value cell in previous row is the same
<p>I have the query:</p>
<pre><code>select RankCode, (SELECT '' + SUBSTRING( CONVERT(VARCHAR, FromDate, 120) ,11, 6) + ' -' + SUBSTRING( CONVERT(VARCHAR, ToDate, 120), 11, 6) ) as WorkingHoursAtSea
from WorkingHoursSchedule
where SeaPortInd = 0 and watchkeepingind = 0
</code></pre>
<p>And this is the result table from the above :</p>
<pre><code>+----------+-------------------+
| RankCode | WorkingHoursAtSea |
+----------+-------------------+
| C/E      |  05:00 - 07:00    |
| C/E      |  01:00 - 02:00    |
| MSTR     |  00:30 - 02:30    |
+----------+-------------------+
</code></pre>
<p>I want to take the following table:</p>
<pre><code>+----------+-------------------+
| RankCode | WorkingHoursAtSea |
+----------+-------------------+
| C/E      |  05:00 - 07:00    |
|          |  01:00 - 02:00    |
| MSTR     |  00:30 - 02:30    |
+----------+-------------------+
</code></pre>
<p>I use MS SQL SERVER 2014.</p>