Per my experience,HAVING
is not supported.
AS a workaround,you can use this sql:
SELECT d.VariantNo,d.jongel
from (Select COUNT(1) AS jongel,c.VariantNo from c where c.brand ='cx' and c.Consumer = 'gx' group by c.VariantNo) d where d.jongel > 1
Below is my test data:
[
{
"id": "1",
"VariantNo": 2,
"brand": "cx",
"Consumer": "gx"
},
{
"id": "2",
"VariantNo": 3,
"brand": "cx",
"Consumer": "gx"
},
{
"id": "3",
"VariantNo": 2,
"brand": "cx",
"Consumer": "gx"
},
{
"id": "4",
"VariantNo": 3,
"brand": "cx",
"Consumer": "gx"
},
{
"id": "5",
"VariantNo": 6,
"brand": "cx",
"Consumer": "gx"
}
]
Here is the output:
[
{
"VariantNo": 2,
"jongel": 2
},
{
"VariantNo": 3,
"jongel": 2
}
]