1~~procedure TForm1.BitBtn1Click(Sender: TObject); var a:array of char; i:integer; begin setlength(a,10); for i:=0 to 9 do a[i]:=chr(i+100); caption:=(string(@a[0])); //以上建立测试~~~ if pos('l',string(@a[0]))>0 then showmessage(''); end;
2~~select * from TABLE where 分数 in (select 分数 from TABLE group by 分数 having(count(分数)>1))或者 select * from TABLE a where (Select Count(*) from TABLE where 分数=a.分数)>1
1、 procedure TForm1.Button1Click(Sender: TObject); var arr:array of String; i:integer; begin setlength(arr,10); for i:=0 to 9 do arr[i]:=inttostr(i)+inttostr(i*i); For i:=0 to 9 do begin if pos('981',arr[i])>0 then begin showmessage('Fount'); break; end; end;end;
2. select 学号,分数 from TABLE group by 学号,分数 having count(分数) > 1
select * from TABLE where 分数 in (select 分数 from TABLE group by 分数 having(count(分数)>1))
var a:array of char;
i:integer;
begin
setlength(a,10);
for i:=0 to 9 do
a[i]:=chr(i+100);
caption:=(string(@a[0]));
//以上建立测试~~~ if pos('l',string(@a[0]))>0 then showmessage('');
end;
(select 分数 from TABLE group by 分数 having(count(分数)>1))或者
select *
from TABLE a
where (Select Count(*) from TABLE where 分数=a.分数)>1
procedure TForm1.Button1Click(Sender: TObject);
var
arr:array of String;
i:integer;
begin
setlength(arr,10);
for i:=0 to 9 do
arr[i]:=inttostr(i)+inttostr(i*i);
For i:=0 to 9 do
begin
if pos('981',arr[i])>0 then
begin
showmessage('Fount');
break;
end;
end;end;
select 学号,分数
from TABLE
group by 学号,分数
having count(分数) > 1
(select 分数 from TABLE group by 分数 having(count(分数)>1))