如题,在线,只要成功马上结帐

解决方案 »

  1.   

    select distinct * from tablename
      

  2.   

    select distinct * into # from b
    truncate table b
    insert into b select * from #
    drop table #
      

  3.   

    Select Distinct Select_list
       From Table
    go
      

  4.   

    delete top 1  from (select * from tablename group by ID 
    having count(*)>2)
      

  5.   

    truncate table b
    insert into b select * from #
    drop table #
      

  6.   

    如学生表里面student 这个表里面 字段 stu_id (学生的学号有好多重复的) 我想把重复的都删了 就剩下一条这个语句怎么写。。
      

  7.   

    1,将重复的记录记入temp1表:
    select [标志字段id],count(*) into temp1 from [表名]
    group by [标志字段id]
    having count(*)>12、将不重复的记录记入temp1表:
    insert temp1
    select [标志字段id],count(*) from [表名]
    group by [标志字段id]
    having count(*)=13、作一个包含所有不重复记录的表:
    select * into temp2 from [表名]
    where 标志字段id in(select 标志字段id from temp1)4、删除重复表:
    delete [表名]5、恢复表:
    insert [表名]
    select * from temp26、删除临时表:
    drop table temp1
    drop table temp2
      

  8.   

    --------------------情况如下-----------------------如学生表里面student 这个表里面 字段 stu_id (学生的学号有好多重复的) 我想把重复的都删了 就剩下一条这个语句怎么写。。
      

  9.   

    select distinct stu_id, * from student
      

  10.   

    delete 
    from tab
    where id not in
    (select min(id) from tab
    group by 学号)