I try to pass subquery to where clause in SQLKata and compare it with 0 value.
In SQL it should be like this:
WHERE (SELECT count(id) FROM main.someTable) > 0
I try to reproduce it in SQLKata by this code:
var countSubQuery =
new Query("main.someTable")
.SelectRaw("count(id)");
return query
.Where("0", "<", countSubQuery);
But I get error message:
column \"'0'\" does not exist
How can I fix this? Maybe I should pass zero value by another way?