How the ANY function works in Base?

Hi, I’d need a bit of help about the ANY function in LibreOffice Base.

Would someone please, help me a bit with this, with a simple example of code?

I know how to use EVERY, SOME, ALL… but I don’t have seen examples from ANY yet.

Would someone help me with this please?

A simple code example would be really helpful.

Cheers

There are of examples in other forums, suggesting the ANY function is similar to IN and EXISTS and can be used in similar circumstances. ANY returns true on the first matched row, ALL returns false on the first non-match. Here is an example:

SELECT *
FROM "Tbl1"
WHERE "Col1" = ANY(SELECT 'str' FROM `Tbl2`)

The direct MySQL connector does not seem to allow the syntax, although MySQL does.

The syntax > ALL(SELECT Col1... is used as a synonym for > (SELECT MAX(Col1 ... with reference to numeric columns.

(if this answers your question, please accept the answer by clicking the check (image description) to the left)

Hi doug, as always, you provide amazing examples. Thanks for your help, I really appreciate that.
Just a question, may I see a simple a screenshot from Tb11, just to understand a bit the data inside the table and what is on Col1… what is on str and also what is on tbl2
As I see… seems to be you can use ANY only in subqueries, right?
Cheers

To test without putting a lot of time into design, I mostly used arbitrary data, I’m not sure screen shots would help much. The query SELECT 'str' FROM "Tbl2" literally returns the text ‘str’ for every row in “Tbl2”. This would be easier if the Base or its connectors were more accommodating of things like SELECT 'str1' AS "a" UNION SELECT 'str2' AS "a", but those return errors. Tbl1 would need to have a row with the text 'str' to make that have effect. ALL is more for numerics.