S02036

Error Code

S02036

Error Message

The size of the result returned by the where condition <xxx> does not match the number of rows in the table. RefId:S02036

Probable Causes

DolphinDB SQL processes the conditions in the WHERE clause on a column-by-column basis. Each condition's result must be a boolean vector of the same length as the number of rows in the selected table.

For example, the condition specified in the WHERE clause, distinct(id)=1, produces a result with fewer rows than the table "t", resulting in an error:

t = table([1, 1, 2, 3] as id)
select * from t where distinct(id)=1

Solutions

Check if the conditions in the WHERE clause result in lengths that do not match the number of rows in the selected table.