Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 19 Jul 2005 @ 16:09:25 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: COALESCE or CASE ?
 
From:   Victor Sokovin

  The thread cited as evidence that there may be "subtle differences" between CASE and COALESCE says nothing of the sort. It merely states that "a" CASE statement didn't work while "a" COALESCE did.  


You simply seem to be a man/woman of categoric statements. This surely makes the discussion interesting!

As I was not sure what exactly the CASE-equivalent of COALESCE was I had to look it up. The V2R5.1 manual gives yet a different syntax from the version you have provided:

"COALESCE is a shorthand expression for the following full CASE expression:

     CASE
     WHEN scalar_expression_1 IS NOT NULL
     THEN scalar_expression_1
     ...
     WHEN scalar_expression_n IS NOT NULL
     THEN scalar_expression_n
     ELSE NULL
     END"

Now, that is a kind of difference I would call subtle (and you probably would call it a totally different CASE) but that is aside.

The example from the thread I have cited is described by the OP as a one-column CASE. I must admit I cannot apply your explanation to it, regardless of which syntax form is used.

I wonder how many users, even with technical background, would be prepared to distinguish these forms of CASE statements or simply able to remember which form exactly they were using. I guess some of them might call the differences subtle, some would call them different words. I have no problem with that.


Regards,

Victor



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023