很简单的sql问题,能帮忙解决么?(以前解决过现在忘了)(100)

  • 主题发起人 主题发起人 jinnys
  • 开始时间 开始时间
J

jinnys

Unregistered / Unconfirmed
GUEST, unregistred user!
就是一句sql语句 SqlStr:='select personID, personname, groupID, groupname, projectID, projectname, actionid, action, catsActionID, nonecatsaction, date, hours, remark from Maintable where projectname='''+ttprojectname+''' group by date';错误提示:“you tried to execute a query that does not include the specifed expression 'PersonId' as part of an aggregate function ”谢谢!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~procedure TForm1.BitBtn5Click(Sender: TObject);var SqlStr,ttprojectname:string;begin ttProjectName:=Edit3.Text; SqlStr:='select personID, personname, groupID, groupname, projectID, projectname, actionid, action, catsActionID, nonecatsaction, date, hours, remark from Maintable where projectname='''+ttprojectname+''' group by date'; DBQuery.Close; DBQuery.SQL.Clear; DBQuery.Sql.Add(sqlstr); DBQuery.Active:=true;end;
 
group by date 错了~~把group by 改为 order by 就行了~`
 
同意楼上
 
谢谢各位!
 
后退
顶部