drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venkata Sowrirajan <vsowrira...@maprtech.com>
Subject Re: LIKE clause escape character
Date Wed, 15 Oct 2014 22:21:57 GMT
Hi Norris,

I believe the escape character for like is '%'. I tried something like this
in Drill and it worked

select * from INFORMATION_SCHEMA.`TABLES` where TABLE_NAME like 's%';

+---------------+--------------+------------+------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE |
+---------------+--------------+------------+------------+
| DRILL         | dfs.drill    | students-view | VIEW       |
| DRILL         | maprdb       | students   | TABLE      |
+---------------+--------------+------------+------------+

Regards

Venkat
MapR Technologies, Inc.

On Wed, Oct 15, 2014 at 2:45 PM, Julian Hyde <julianhyde@gmail.com> wrote:

> I believe that according to the SQL standard you have to provide one
> explicitly. And therefore you get to choose your own. Most people use
> back-slash.
>
> Thus:
>
> > Select * from INFORMATION_SCHEMA.`TABLES` where TABLE_NAME LIKE
> 'bit#_table' ESCAPE '#'
>
>
> will find only tables with underscores. The same character can escape both
> '%' and '_'.
>
> I don't know whether Drill does this, but Calcite does.
>
> Julian
>
>
> On Oct 14, 2014, at 7:41 PM, Norris Lee <norrisl@simba.com> wrote:
>
> > Hi,
> >
> > Does anyone know what the escape character is for the LIKE clause?
> > Eg. Select * from INFORMATION_SCHEMA.`TABLES` where TABLE_NAME LIKE
> 'bit_table';
> > I want to look for the underscore, not a wildcard.
> >
> > Thanks,
> > Norris
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message