本文整理自网络,侵删。
学习 SQL 语句 - Select(8): 分组条件
代码文件:
--------------------------------------------------------------------------------
//分组条件可以是 Where
procedure TForm1.Button1Click(Sender: TObject);
begin
with ADODataSet1 do begin
Close;
CommandText := 'SELECT Continent, AVG(Area) AS 平均面积 ' +
'FROM country WHERE Continent="South America" GROUP BY Continent';
Open;
end;
end;
//也可以是 Having
procedure TForm1.Button2Click(Sender: TObject);
begin
with ADODataSet1 do begin
Close;
CommandText := 'SELECT Continent, AVG(Area) AS 平均面积 ' +
'FROM country GROUP BY Continent HAVING Continent<>"South America"';
Open;
end;
end; 相关阅读 >>
Delphi android使用idhttp.get抓取https(ssl)文件
Delphi tidhttp+tidssliohandlersocket+ssl
Delphi idhttp组件+idhttpserver组件实现文件下载服务
Delphi filesearch 获取指定文件夹下所有文件包括隐藏文件
Delphi 在firemonkey应用程序中使用torientationsensor获取设备倾斜和指南针航向
移植Delphi7的tclientsocket,tserversocket
更多相关阅读请进入《Delphi》频道 >>