就是
select count(*) from table where cond
select avg.........
这些数值如何获取到程序中
前面有个帖子问过count(),但没大看明白
各位大牛可否解释一下
ps:使用odbc,如果没有,其他方式的也行

解决方案 »

  1.   

    =====================================================================
    CString strSQL;strSQL = "SELECT COUNT(*) AS ttt FROM book";m_pRecordset->Open(_variant_t(strSQL),
    m_pConnection.GetInterfacePtr(),
    adOpenDynamic,
    adLockOptimistic,
    adCmdText);_variant_t var;var = m_pRecordset->GetCollect("ttt");
    var.ChangeType(VT_I4);strSQL.Format("%d",var.lVal);AfxMessageBox(strSQL);
    =====================================================================SELECT COUNT(*) AS ttt FROM book把 COUNT(*) 作为 ttt,你就把 ttt 当作一个字段就行了。