Added COALESCE support to SELECT

Cherry-Picked commit 7a521de from master