T
T
Torento203452021-11-02 16:45:49
PostgreSQL
Torento20345, 2021-11-02 16:45:49

How does the LIKE AND LIKE construct work?

Good evening
When we write in a WHEREcondition Does
weight LIKE %10% AND weight LIKE %15%
it look for a line with weight10 in it, and after that it checks for 15?
In the sense that such a request does not force it to go through the database 2 or more times, depending on the quantities LIKE, what will be an unnecessary load?
And as I understand it, the same logic will be present when mixing ANDand OR?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ronald McDonald, 2021-11-02
@Torento20345

Does it look for a string with weight that contains 10, and after that it checks for the presence of 15?

Yes.
such a query does not force it to go through the database 2 or more times, depending on the number of LIKEs

No, only one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question