title: SQL Create Unique Value Flag
body: <p>There are lots of questions/answers about selecting unique values in a MySQL query but I haven't seen any on creating a unique value flag.</p>
  <p>I have a customer_ID that can appear more than once in a query output. I want to create a new column that flags whether the customer_ID is unique or not (0 or 1).</p>
  <p>The output should look something like this:</p>
  <pre><code>ID     | Customer ID      | Unique_Flag
  1      | 1234             | 1
  2      | 2345             | 1
  3      | 2345             | 0
  4      | 5678             | 1
  </code></pre>
  <p>Please let me know if anybody needs clarifications.</p>