User12345
User12345

Reputation: 5480

NOT LIKE statement in Hive

In mysql I am using the following statement to find tables not like in a database.

show tables where `Tables_in_db` not like '%_table'

I am able to use the statement like below to find tables like in hive

show tables like '*table' 

But unable to use the not like statement

show tables where `Tables_in_db` not like '*_table'

Is there an equivalent for this statement in Hive.

Upvotes: 2

Views: 5688

Answers (1)

Keshav Pradeep Ramanath
Keshav Pradeep Ramanath

Reputation: 1687

The below one can be used:

In SQL:

select * from tableName where columnName not like '%something%';

In Hive:

select * from tableName where not (columnName like '%something%');

Hope it helps.

Upvotes: 4

Related Questions