You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is similar to #8280, which seems to only partially have been solved. When using count(*) and there are no matching items a proper result set is returned with a count of 0. However if you use count(<field>) and there are no matching elements an empty result set is returned.
CREATE CLASS Person;
CREATE PROPERTY Person.name STRING;
SELECTcount(*) as count from Person;
-- returns: [{@version: 0, count: 0}]SELECTcount(name) as count from Person;
-- returns: []INSERT INTO Person SET name="bob";
SELECTcount(*) as count from Person;
-- returns: [{@version: 0, count: 1}]SELECTcount(name) as count from Person;
-- returns: [{@version: 0, count: 1}]SELECTcount(*) as count from Person WHERE name ="susan";
-- returns: `[{@version: 0, count: 0}]`SELECTcount(name) as count from Person WHERE name ="susan";
-- returns: []
So it seems like count(*) works properly. count(<field>) works when results match, but not when there are not records that match the SELECT.
The text was updated successfully, but these errors were encountered:
OrientDB Version: 3.0.9
This is similar to #8280, which seems to only partially have been solved. When using
count(*)
and there are no matching items a proper result set is returned with a count of 0. However if you usecount(<field>)
and there are no matching elements an empty result set is returned.So it seems like
count(*)
works properly.count(<field>)
works when results match, but not when there are not records that match the SELECT.The text was updated successfully, but these errors were encountered: