Hi,
I am looking for the correct syntax for "IN" or "NOT IN" with "Read data". Most things I tried give back a « 1064 SQL syntax error ».
For example, let's say I want to do this basic query :
Table field name : table.country
Condition : IN
... what can I type into the "Value" field ?
If it is simpler from "Where conditions > Rules list", what would be the syntax ? I tried many things like ...
data.country/in:(USA, FRANCE )
data.country/in:( `USA`, `FRANCE`)
simple quotes with escapement, double quotes, ... .etc. Each time, it seems like CCv6 treats it as a whole string (surrounded by simple quotes).
I managed to use the "IN" operator with a PHP array returned from another function. But I keep on hoping there is a simpler way to use "IN" than to create an extra function that needs to be (re)declared for each Event.
Also, what is the rules syntax for "NOT IN" ( data.id/not_in: ... , data.id/not in: ... ) ?
At last, how to use a subquery into a "Where conditions" ?
Sorry if it looks like topics mix, but I am just trying to migrate a connection from CCv5 in which all I had to enter under "Condition" was something very simple like :
I am looking for the correct syntax for "IN" or "NOT IN" with "Read data". Most things I tried give back a « 1064 SQL syntax error ».
For example, let's say I want to do this basic query :
SELECT id FROM data WHERE country IN ('USA' , 'France');If I use a "Where conditions > Condition" with ..
Table field name : table.country
Condition : IN
... what can I type into the "Value" field ?
If it is simpler from "Where conditions > Rules list", what would be the syntax ? I tried many things like ...
data.country/in:(USA, FRANCE )
data.country/in:( `USA`, `FRANCE`)
simple quotes with escapement, double quotes, ... .etc. Each time, it seems like CCv6 treats it as a whole string (surrounded by simple quotes).
I managed to use the "IN" operator with a PHP array returned from another function. But I keep on hoping there is a simpler way to use "IN" than to create an extra function that needs to be (re)declared for each Event.
Also, what is the rules syntax for "NOT IN" ( data.id/not_in: ... , data.id/not in: ... ) ?
At last, how to use a subquery into a "Where conditions" ?
Sorry if it looks like topics mix, but I am just trying to migrate a connection from CCv5 in which all I had to enter under "Condition" was something very simple like :
<?php return array( ": data.country In ('USA', 'FRANCE') AND data.country Not In (Select table.name From table) "); ?>Thanks for reading & for your help !