摘要:
//只要前五条记录procedure TForm1.Button1Click(Sender: TObject);begin with ADODataSet1 do begin Close; CommandText := 'SELECT TOP 5 * FROM country'; Open; end;end;//去除重复procedure TForm1.Button2Click(Sender:... 阅读全文
posted @ 2009-05-28 18:42
万一
阅读(3396)
评论(9)
推荐(0)
摘要:
代码文件://分组条件可以是 Whereprocedure TForm1.Button1Click(Sender: TObject);begin with ADODataSet1 do begin Close; CommandText := 'SELECT Continent, AVG(Area) AS 平均面积 ' + 'FROM country WHERE Continent="South ... 阅读全文
posted @ 2009-05-28 17:54
万一
阅读(3598)
评论(0)
推荐(0)
摘要:
Group By本来 Group By 也可以根据多个字段分组("," 隔开), 但这个例子只有 Continent 字段适合分组, 也只有 Area、Population 字段适合统计.本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, F... 阅读全文
posted @ 2009-05-28 16:43
万一
阅读(4076)
评论(0)
推荐(0)
摘要:
本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = class(TForm) DBGr... 阅读全文
posted @ 2009-05-28 16:12
万一
阅读(4424)
评论(0)
推荐(0)
摘要:
本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = class(TForm) DBGr... 阅读全文
posted @ 2009-05-28 15:23
万一
阅读(4673)
评论(0)
推荐(0)
摘要:
Order By Asc|Desc本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = ... 阅读全文
posted @ 2009-05-28 14:39
万一
阅读(4776)
评论(2)
推荐(0)
摘要:
Where 用来指定查询条件;Like 和 Not Like 来指定模糊条件;模糊条件中:_ 表示任一字符;% 表示任一字符串;[] 表示一个集合.本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdC... 阅读全文
posted @ 2009-05-28 13:03
万一
阅读(7866)
评论(3)
推荐(1)
摘要:
//选择 country 表中的 Name 字段SELECT Name FROM country//选择 country 表中的 Name、Area 和 Population 字段SELECT Name,Area,Population FROM country{多个字段时, 字段名是用 "," 隔开的}本例效果图:代码文件:unit Unit1;interfaceuses Windows, Me... 阅读全文
posted @ 2009-05-28 01:51
万一
阅读(5582)
评论(4)
推荐(0)
摘要:
//选择 country 表中的所有字段SELECT * FROM country{虽然 SQL 并不区分大小写, 但应习惯把关键字大写}本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,... 阅读全文
posted @ 2009-05-28 01:40
万一
阅读(6278)
评论(7)
推荐(1)
摘要:
本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, DB, DBClient, StdCtrls, ExtCtrls;type TForm1 = class(TForm) P... 阅读全文
posted @ 2009-05-28 00:00
万一
阅读(10943)
评论(20)
推荐(0)
浙公网安备 33010602011771号