title: Teradata SQL - select distinct returning duplicate rows where one row has null values
body: <p>I'm stuck on query where i'm joining multiple tables to bring in attributes I need for a specific primary key. What I'm finding is I'm receiving duplicate rows, which are essentially the same, but one row has null (?) values in a few columns. I only want to return the row with populated data.</p>
  
  <p>I've checked all of my vol tables up to this point and there are no duplicates and I have the same distinct row count until my final vol table. I am joining in new data from other tables in the final vol table, and will post that query, but just curious if anyone knows why this would happen with "SELECT DISTINCT". </p>
  
  <p>I tried using a clause "WHERE PROD_LN IS NOT NULL", but I have some that are not duplicates and will not have values for PROD_LN. I was also thinking of trying a "CASE WHEN PROD_LN IS NULL THEN PROD_LN = PROD_LINE NOT NULL" but not sure if that would work. Any help is appreciated!</p>
  
  <pre><code>        ACCT_NAME | GRP_ID   |  GRP_B  | ASGND_CD | PROD_LN | PROD_TYP | PLCY_TYP | FINCL | MKT_SGMT |
      ENTERPRISE A  | 00012345 |  N12345 |    1     |    ?    |     ?    |     8    |   ?   |     ?    |
      ENTERPRISE A  | 00012345 |  N12345 |    1     |    H    |   SPPO   |     8    |  ASO  |    AFG   |
  </code></pre>