title: How do I replace NULL values with string using COALESCE function?
body: <p>Trying to put 'unassigned' to the null values using coalesce function within the select statement.
  Here is the code:</p>
  <pre><code>SELECT ORDER_ID, ORDER_DATE,
  coalesce (SALES_REP_ID,'NA') REP
  FROM ORDERS```
  [But having error &quot;inconsistent datatype&quot;]
  How do I fix it?
  
  [Data, in which sales_rep_id have null values which i want to change it to 'unassigned']
  </code></pre>