我正在尝试嵌套此查询,但我收到错误:类型为boolean的输入语法无效:“%faults%”。
select *
from (
select column_one, column_two
from table
group by column_one, column_two
) as new_table
where column_two like '%false%' or '%malfunction%' or '%accidental%' or '%mistaken%'
order by column_one
Column_two不是布尔值,但它将其标识为一个。 我觉得我错过了一些小东西,但我找不到它。救命啊!
答案 0 :(得分:1)
您可以使用any(array[...])
,例如:
with test (col) as (
values
('pear'), ('banana'), ('apple')
)
select *
from test
where col like any(array['%ea%', '%ba%']);
col
--------
pear
banana
(2 rows)
答案 1 :(得分:0)
正确的语法类似于select col1,col2, 来自table_name where condition1 OR condition2 OR condition3 ...;