0

我们如何在 activejdbc 中获得不同的行数?我尝试了许多不同的变体,但没有一个奏效

Tablename.count("?", "distinct id")
Tablename.count("distinct ?", "id") //missing expression
Base.exec("select count(distinct id) from tablename") //return 1 always (probably the count)
4

1 回答 1

0

您使用了错误的 API。由于您正在选择,因此您需要使用任何一种Base.find...方法,而不是Base.exec用于 INSERT/UPDATE/DELETE 的方法。

于 2015-03-26T02:18:50.137 回答