Home > Software design >  how to use Like any, like all in spark
how to use Like any, like all in spark

Time:05-12

I was trying to use like any and like all in this query in Spark/ Dremio SQL

SELECT * FROM table_name where col_name LIKE ANY (CONCAT('%', 10, '%'), CONCAT('%', 20, '%'), CONCAT('%', 12, '%'))
SELECT * FROM table_name where col_name LIKE ALL (CONCAT('%', 10, '%'), CONCAT('%', 20, '%'), CONCAT('%', 12, '%'))

it is. showing error :

Failure parsing the query.

BY USING any I want to select all the rows with either 10, 20 or 12values and by using all I was trying to get a value which has all 3 values in it. kindly help in resolving the query

CodePudding user response:

SELECT * FROM table_name where col_name LIKE '%' AND col_name LIKE ' %' AND col_name LIKE '%'

SELECT * FROM table_name where col_name LIKE '%' OR col_name LIKE ' %' OR col_name LIKE '%'
  • Related