wcdb
wcdb copied to clipboard
getOneDistinctColumnOnResult 被移除之后,如何实现同样的查询
The language of WCDB
Objective-C
The version of WCDB
2.1.8
The platform of WCDB
iOS
The installation of WCDB
Cocoapods
What's the issue?
尝试了下面的代码,转换出来的 sql 并没有按预期包含 distinct
WCTOneColumn *result = [_database getColumnOnResultColumn:WCDB::Expression(MGEpisodeWatchedItem.cartoon_id).distinct()
fromTable:[self.class episodeWatchTableName]];
这段代码生成的 sql 是
SELECT cartoon_id FROM episode_watch ORDER BY rowid ASC
没有找到如何才能实现 select distinct cartoon_id ***,故发 issue 求助
[self.database getColumnFromStatement:WCDB::StatementSelect().select(MGEpisodeWatchedItem.cartoon_id).distinct().from([self.class episodeWatchTableName])]