Sql.Add('select username from table where username=:a');
Parmas[0].AsString:=Name;//Name 为要判断的用户名
Open
 if Eof then
   ShowMessage('不存在')
  else
   ShowMessage('存在');

解决方案 »

  1.   

    如果不用找出具体的用户名,我有个简单的办法!
    select counts(name)  from table1
    select counts(distinct name) from table1
    取出两个值比较就行了!
      

  2.   

    在Table组件中如何对一行操作
    用Table组件怎么做
      

  3.   

    一个笨办法:
    用两个table连接同一个表,一个定位,另一个对前一table定位的记录进行过滤,如果有一个以上的记录,说明有重复!
      

  4.   

    ……
    table1.first;
    while not table1.eof do
    begin
      table2.filter:='name='''+table1.fieldbyname('name').asstring+'''';
      if talbe2.recordcount>1 then
        showmessage('存在');
    end;