addNotNullQuery(String fieldName) can be used.Example: To get all the records where ‘name’ is not null.addNotNullQuery(‘name’);