sqlite数据库中"Select * From XXX能查到数据,但是Select DISTINCT group From xxx Order By group却查不出来
数据库中"Select * From XXX能查到数据,但是Select DISTINCT group From xxx Order By group却查不出来
从返回值 ret看2种情况下都是0.
int ret;
ret = sqlite3_prepare_v2(db, buf, -1,&stmt,0);
TRACE("Ret:%d\r\n", ret);
是下面这一句:
while (sqlite3_step(stmt)==SQLITE_ROW)//还有记录
{
const char* pName = (const char*)sqlite3_column_text(stmt, 0);// select * 时 参数用的是1 , select distinct 时 要用 0.
//CString s = (CString)pName + "\r\n";
CString s = (CString)pName ;
TRACE(s+"\r\n");
m_projFolder.InsertItem(0, pName);
}