The results from a sql query produces the following table:
|SEDOL | ISIN | Cash |
=============================
|ZZZ0072|GB00B7JYLW09| null |
-----------------------------
|CASH |GB00B7JYLW09| null |
-----------------------------
|ZZZ0072|GB00B7JYLW09| null |
-----------------------------
|ZZZ0009|GB00B7JYLW09| null |
-----------------------------
I would like help with a query that will replace the null values in the Cash field with values (any value) from the table testtable with field ‘IsCash’ and to return the following table:
=============================
|SEDOL | ISIN | Cash |
=============================
|ZZZ0072|GB00B7JYLW09|150146|
-----------------------------
|CASH |GB00B7JYLW09| 182 |
-----------------------------
|ZZZ0072|GB00B7JYLW09| 1190 |
-----------------------------
|ZZZ0009|GB00B7JYLW09| 2000 |
-----------------------------
The testtable is:
| IsCash |
==============
| 36 |
--------------
| 150146 |
--------------
| 182 |
--------------
| 2000 |
--------------
| 200952 |
--------------
| 200000 |
--------------
| 350000 |
--------------
| 150000 |
--------------
| 1190 |
--------------
I think I would need to apply the ISNULL statement to the ‘Cash’ field, but I’m not sure on the clause used to issue the replace statement from the testtable with the IsCash field