比如有100条教师记录,教授,副教授,讲师,助教各若干,有没有什么SQL命令可以直接筛选出职称的种类.

解决方案 »

  1.   

    select 职称 from 表 Group by 职称
      

  2.   

    SQL:--查询职称属于教授的数据
    select * from 数据表名 where 职称='教授'
    DELPHI :procedure TForm1.Button1Click(Sender: TObject);
    begin
    {例如,控件edit1输入你想查询的职称}
      with adoquery1 do begin
        close;
        sql.Text:='select * from 数据表名 where 职称='''+trim(edit1.Text)+'''';
        open;
      end;
    end;
      

  3.   

    select distinct(职称字段名) from 表名
      

  4.   

    没有表结构,只能猜了
    select count(distinct 职称) from 表名
      

  5.   

    select 职称,count(*) 个数 from 表 Group by 职称 order by 职称
      

  6.   

    select distinct(职称字段名) from table  
      

  7.   

    只要这样子就可以了:
    select distinct(职称字段名) from 表名
      

  8.   

    select distinct(职称字段名) from 表名