select count(*) as :nCount from t_table where Name =:Name;
错误提示:as :nCount 有问题,请问正确表述是什么?
谢谢
...全文
715打赏收藏
[求助]如何使用sum 和count
我想求出搜索结果的总数,并把它存储在nCount中,如何做? int nCount =0; AnsiString Name ="1"; select count(*) as :nCount from t_table where Name =:Name; 错误提示:as :nCount 有问题,请问正确表述是什么? 谢谢
int nCount =0;
ADOQuery1->Close();
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("select * from t_table where Name =:Name");
ADOQuery1->Open();
nCount = ADOQuery1->RecordCount; //结果记录数
str="select count(*) as pp from t_table where Name ='"+Name+"'";
ADOQuery->SQL->Text=str;
ADOQuery->Open();
temp=ADOQuery->FieldByName("pp")->AsString;