Open rush2ko opened 8 years ago
No, it is not correct. Key value to start the searching has not been specified.
at.index(0).keyValue(INT_MIN).read(q, rs);
InfoSN
is not unsigned. The start value must be INT_MIN
to read from the first record.
There is a much faster way than above.
table* tb = db->openTable(L"recommand_info", TD_OPEN_READONLY);
uint_td count= tb->recordCount(false);
tb->release();
thanks.
Thank you so much.
It is a sample table. CREATE TABLE
recommand_info
(InfoSN
INT(11) NOT NULL AUTO_INCREMENT,UserSN
INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (InfoSN
), UNIQUE INDEXUserSN
(UserSN
) ) COLLATE='utf8_general_ci' ENGINE=InnoDB;I want to full record count from recommand_info table.
with activeTable:
query q; recordset rs; q.select(L"UserSN").reject(0xFFFF); at.read(q, rs); count = rs.size();
or
query q; recordset rs; q.select(L"UserSN").where(L"UserSN", L">", 0).reject(0xFFFF); at.read(q, rs); count = rs.size();