求大神指点这个表怎么查询能不出现重复记录

AI_Ansewer AI_Ansewer 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
create table Lxl_SoftwareMainTenanceRecord 
(
R_ID Nvarchar(50) primary key not null, --编号
R_RID int foreign key references Lxl_SoftwareInfo(S_ID), --软件名称,外键(软件)
R_SMRID Nvarchar(30) foreign key references Lxl_EmpInfo(Emp_ID), --维护人,外键(员工)
R_STime Date not null,--申请时间
R_Phone Nvarchar(30) not null,--客户电话,外键(客户信息)
R_CDate Date not null default getdate(), --完成时间
R_Cause Nvarchar(Max) not null, --技术问题原因
R_Solution Nvarchar(Max) not null, --解决办法
R_Operator Nvarchar(30) foreign key references Lxl_Operator(O_ID) not null, --操作员
R_BZ int not null default(0) --标识
)
...全文

相关推荐

SQL重复记录查询 查询多个字段、多表查询、删除重复记录的方法

SQL重复记录查询 1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断  select * from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 例二:  select * from testtable where numeber in (select number from people group by number having count(number) > 1 ) 可以查出testtabl

weixin_38502639

解析mysql中:单表distinct、多表group by查询去除重复记录

单表的唯一查询用:distinct多表的唯一查询用:group bydistinct 查询多表时,left join 还有效,全连接无效,在使用mysql时,有时需要查询出某个字段不重复的记录,虽然mysql提供有distinct这个关键字来过滤掉多余的重复记录只保留一条,但往往只用它来返回不重复记录的条数,而不是用它来返回不重复记录的所有值。其原因是distinct只能返回它的目标字段,而无法返回其它字段,用distinct不能解决的话,我只有用二重循环查询来解决,而这样对于一个数据量非常大的站来说,无疑是会直接影响到效率的。下面先来看看例子:表的结构如下:id name1 a2 b3 c4

weixin_38529123

SQL重复记录查询的几种方法

SQL重复记录查询的几种方法,需要的朋友可以参考一下

weixin_38742520

Oracle查询重复数据与删除重复记录方法

  几个删除重复记录的SQL语句   1.用rowid方法   2.用group by方法   3.用distinct方法   1。用rowid方法

wujianbin_12

SQL语句去掉重复记录,获取重复记录

SQL语句去掉重复记录,获取重复记录

weixin_38710323
评论 18
收藏 已收藏
分享
返回顶部
AI_Ansewer
MS-SQL Server 34,876 成员 254,635 内容