phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jamestay...@apache.org>
Subject Re: LIKE operator in Phoenix
Date Mon, 09 Jun 2014 05:16:25 GMT
You can do the following instead:

select * from account_service_history  where CAST(ash_id AS VARCHAR)
LIKE  '217%';

If this is a common operation, might be better to use VARCHAR instead
of INTEGER for your column type.

Thanks,
James

On Sun, Jun 8, 2014 at 10:08 PM, Ramya S <ramyas@suntecgroup.com> wrote:
> Hi,
>
>
> Consider the below query as an example, where the ASH_ID column is INTEGER type.
>
> select * from account_service_history  where ash_id LIKE  '217%';
>
>
> While firing such a query in phoenix gives a type mismatch error.
>
> Does phoenix handles  type cast of Integer/Double to a string  internally?
>
>
>
> Thanks
>
> Ramya.S
>
>
> ________________________________
>
> From: James Taylor [mailto:jamestaylor@apache.org]
> Sent: Mon 6/9/2014 9:48 AM
> To: user
> Subject: Re: LIKE operator in Phoenix
>
>
>
> Can you give an example of what you mean? LIKE is for strings, but you
> can cast an Integer/Double to a string.
>
> Thanks,
> James
>
> On Sun, Jun 8, 2014 at 9:02 PM, Ramya S <ramyas@suntecgroup.com> wrote:
>>
>>
>> Does the LIKE operator in phoenix support  Integer/Double  column values ?
>>
>>
>>
>> Thanks
>> Ramya.S
>>
>>
>
>

Mime
View raw message