db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John English <john.fore...@gmail.com>
Subject Re: How best to handle null in cast of column subquery
Date Thu, 13 Feb 2014 10:12:46 GMT
On 12/02/2014 17:38, Frank Rivera wrote:
> How best to handle null in cast of column subquery?
> There are five records each with data in every column but when we run this
> statement below only some of the columns are returned.
> *If we remove the cast statement then all columns are returned. The Age column
> is null in the records not being returned.*
> *CAST(AGE AS varchar(3)) ||'|'||*

Perhaps use something like this:
   CASE WHEN Age IS NULL THEN '' ELSE Age END || '|'
-- 
John English

Mime
View raw message