SQL-内部联接无法引用的5条记录 [英] SQL - 5 records that cannot be referenced by inner join

查看:52
本文介绍了SQL-内部联接无法引用的5条记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.

我正在使用SQL 2005 Express.

我有一个表,其中有一个名为rec_id的自动递增字段.该表有5条有趣"记录,rec_id 33941到33945.仅供参考,该表添加记录没有问题,rec_id现在已经超过了这5条记录,即34000+.我们今天才发现这5条记录.

如果我执行"从masterreceipt中选择rec_id ",则即使我在命令中添加了" order by rec_id ",这组5条记录也将始终保留在最底部的5条记录中. .结果将如下所示.
.
.
.
34810
34811
34812
33941
33942
33943
33944
33945

但是,如果我在同一命令中进一步添加" desc ",则这组5条记录将根本不会出现.

而且,这5条记录不能被其他表内部联接".它不会返回行.

我很确定记录集从来没有通过更新或删除命令来完成.我还检查了内容,没有任何异常.

有人可以告诉我怎么回事吗?

谢谢.

Hello.

I am using SQL 2005 Express.

I have a table with an auto increment field named rec_id. This table has 5 ''funny'' records, rec_id 33941 to 33945. Fyi, the table has no problem adding records and the rec_id now has gone beyond that 5 records, 34000+. We only discovered these 5 records today.

If I do a "Select rec_id from masterreceipt", that set of 5 records will always remain at the bottom 5, even if I added "order by rec_id" to the command. The result will look something like this.
.
.
.
34810
34811
34812
33941
33942
33943
33944
33945

But if I further add "desc" to the same command, that set of 5 records will not appear at all.

And also, that 5 records cannot be ''inner join'' by other tables. It will not return the rows.

I am pretty sure that set of records has never been thru an update or a delete command. I''ve checked the content as well, nothing out of the ordinary.

Can anybody please tell me what is going on?

Thank you.

推荐答案

我修改了表,关闭了所述字段的IsIdentity属性.当我检查时,这5条记录按输入顺序恢复了原位.重新打开IsIdentity属性后,一切再次正常.

但我想知道是什么原因造成的.我需要向我的客户解释一下,因为这看似简单的问题导致客户服务失败,导致投诉.我需要告诉他们,不是我的程序导致了它.
I modified the table, turning off the IsIdentity property of the said field. When I checked, the 5 records were back in place, at the order of entry. After turning back on the IsIdentity property, everything works fine again.

But I wonder what causes it. I need to explain it to my customers coz this seemingly simple problem caused a customer service failure resulting in a complain. I need to tell them that it is not my program that causes it.


这篇关于SQL-内部联接无法引用的5条记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆