title: SQL Query for an update of a column based on other column's data in a Table
body: <p>I need to write an SQL query to take either from one of two column's data(based on whichever is available and not null) and append it to a static text into another column within the same table.</p>
  
  <p>Can anybody tell me how to write this?</p>
  
  <p>Example Data :</p>
  
  <pre><code>ID  Type   Barcode  Serial No  Location
  
  1   Test    ABCD     1234       LOC1  
  2   Test    EFGH     NULL       LOC2  
  3   Test    NULL     5678       LOC3  
  4   Test    NULL     NULL       LOC1  
  </code></pre>
  
  <p>Final Data Reqd in Format</p>
  
  <pre><code>ID  Type  Barcode  Serial No  Location
  
  1   Test  ABCD     1234       LOC1-ABCD   (Append barcode if its not null)  
  2   Test  EFGH     NULL       LOC2-EFGH   (Append barcode if its not null)  
  3   Test  NULL     5678       LOC3-5678   (Append serial no since barcode is null)  
  4   Test  NULL     NULL       LOC1        (Both r Null keep loc as it is)  
  </code></pre>
  
  <p>Please help me on it....really stuck on this :(</p>
  
  <p>Database is Oracle 10.</p>
  
  <p>Supra</p>
  
  <p>Update 1 :</p>
  
  <p>Thanks a lot Marco for your help....the location field only needs to updated in the table after appending the barcode/serial no from the same table into location field. Your edited query is not working :(...please let me know if I need to give some more info/data.</p>
  
  <p>Final Update :</p>
  
  <p>Shesek's Answer worked perfect :D...you are the man :)...Thanks a ton :D</p>