title: SQL Getting Non-Repeating Values [Oracle SQL*Plus]
body: <p>I have a  table(order_t) that contains CustomerIDs and SalespersonIDs and I want to display SalespersonIDs with all the CustomerIDs associated with them.</p>
  
  <p>I tried using SELECT DISTINCT</p>
  
  <pre><code>SELECT DISTINCT salespersonid, customerid
  FROM order_t;
  </code></pre>
  
  <p>But that will repeat salespersonids. </p>
  
  <p>Here is a table sample</p>
  
  <pre><code>salespersonid   customerid
  --------------- ---------------
  15              1
  15              2
  15              3
  16              4
  16              5
  17              6
  </code></pre>
  
  <p>And I want to get this dataset as the result</p>
  
  <pre><code>salespersonid   customerid
  --------------- ---------------
  15              1
                  2
                  3
  16              4
                  5
  17              6
  18              4
                  5
                  9
  </code></pre>
  
  <p>This worked perfectly</p>
  
  <pre><code>BREAK ON sid
  SELECT DISTINCT salespersonid sid, customerid cid
  FROM ORDER_T
  ORDER BY salespersonid;
  </code></pre>