Oracle Differences between NVL and Coalesce

COALESCE is more modern function that is a part of ANSI-92 standard. NVL is Oracle specific, it was introduced in 80‘s before there were any standards. In case of two values, they are synonyms. However, they are implemented differently. NVL always evaluates both arguments, while COALESCE usually stops evaluation whenever it finds the first non-NULL … Read more

Combine rows / concatenate rows

Here is a sample User Defined Function (UDF) and possible usage. Function: Function Coalsce(strSQL As String, strDelim, ParamArray NameList() As Variant) Dim db As Database Dim rs As DAO.Recordset Dim strList As String Set db = CurrentDb If strSQL <> “” Then Set rs = db.OpenRecordset(strSQL) Do While Not rs.EOF strList = strList & strDelim … Read more

How to implement coalesce efficiently in R

From data.table >= 1.12.3 you can use fcoalesce. library(data.table) fcoalesce(a, b, c) # [1] 1 2 NA 4 6 fcoalesce can also take “a single plain list, data.table or data.frame”. Thus, if the vectors above were columns in a data.frame (or a data.table), we could simply supply the name of the data set: d = … Read more