title: Add new column with binary (o and 1) data with t-sql based on a combination of other columns in a table
body: <p>I have requirement to insert binary code (0,1) into new column to identify same set of columns (Subject_code, Start, Organizer) in a table. Here is an example</p>
  
  <pre><code>ID  Subject_code    Start   Organizer   status
  44297   A1           8AM       X         Open
  60053   A2           4PM       y         Open
  36602   B1           3PM       X         Done
  57914   B1           3PM       X         Done
  27464   B1           3PM       X         Open
  29043   B3           8AM       Y         Open
  58400   B3           8AM       Y         Done
  </code></pre>
  
  <p>And the desired outcome is shown below. 1 will be assigned to the first record of similar combination of columns (Subject_code, Start, Organizer)  and 0 for the rest of the records.</p>
  
  <pre><code>ID  New_Code    Subject_code    Start   Organizer   status
  44297   1         A1            8AM      X          Open
  60053   1         A2            4PM      y          Open
  36602   1         B1            3PM      X          Done
  57914   0         B1            3PM      X          Done
  27464   0         B1            3PM      X          Open
  29043   1         B3            8AM      Y          Open
  58400   0         B3            8AM      Y          Done
  </code></pre>
  
  <p>I couldn’t come up with tsql code with the limited time I have. </p>