0

I need to get the data from a DB and match two columns: Key and name, but I cant get it to work, if I use AND on both conditions:

...where lower(items.key_) SIMILAR TO lower('memory.size')
   and lower(items.name) SIMILAR TO lower('Memory Utilization%')
   and history.clock > '2020-08-12 03:05:32'

the query doesnt work because when items.key is similar to memory.size, items.name will never be similar to "Memory Utilization", so I try to do it with OR:

...where lower(items.key_) SIMILAR TO lower('memory.size')
   or lower(items.name) SIMILAR TO lower('Memory Utilization%')
   and history.clock > '2020-08-12 03:05:32'

But it doesnt work either.

Any Ideas?

1 Answer 1

2

SIMILAR TO is not really the operator you want. You are using %, so that suggests LIKE:

where (lower(items.key_) like lower('memory.size') or
       lower(items.name) like lower('Memory Utilization%')
      ) and history.clock > '2020-08-12 03:05:32'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.