Different syntax, but it looks like the CASEWHEN function should do what you 
need:

https://ignite.apache.org/docs/latest/sql-reference/system-functions#casewhen

> On 17 Jan 2022, at 07:58, Karthik Nandagiri 
> <karthik.nandag...@costrategix.com> wrote:
> 
> Hi Team,
> 
> I want to write below SQL with Ignite SQL case.
> 
> SELECT c.postalcode,CASE WHEN(c.postalcode is not null and 
> (length(c.postalcode)=5 or length(c.postalcode)=10 or length(c.postalcode)=9) 
> and REGEXP_LIKE(c.postalcode,'(^\\d{5}$)|(^\\d{9}$)|(\\d{5}-\\d{4})$','i')) 
> THEN 1 WHEN (c.postalcode='00000' AND (length(c.postalcode)=0 or 
> length(c.postalcode)<5)) THEN 0      else      0   END AS col  from customers 
> as c join zipcodelkup as l on c.postalcode=l.postalcode;
> 
> Is this type of case statement valid in Ignite? if yes please suggest some 
> examples?
> not able to find any examples here on the ignite documentation below
> https://ignite.apache.org/docs/latest/sql-reference/system-functions 
> <https://ignite.apache.org/docs/latest/sql-reference/system-functions>
> 
> Regards
> Karthik N
> 
> 
> 

Reply via email to