索引的问题(未解决)
授权方式:署名,非商业用途,保持一致,转载时请务必以超链接(http://www.fwolf.com/blog/post/355)的形式标明文章原始出处和作者信息及本声明。服务器环境:windows2000,sybase ASE 11.9.2
一个表,里面的三个字段A B C均为字符串类型(varchar或者char),其中C的实际数据为c1, c2, c3等有限的几种。表的主键和索引都不是ABC三个字段。下面的sql语句:
SELECT * FROM tbl_name WHERE A='a' AND (C='c1' OR (C='c2' AND B='b'))
是能够正常执行,得到数据的。但是当在字段C是创建索引:
CREATE INDEX idx_name ON tbl_name(C)
之后,上面的SELECT sql语句也能正常执行,但却无法得到数据了。而在创建索引前后,符合WHERE条件的数据是肯定存在的,所以可以理解为这个索引导致了sql的执行结果无数据;在删除索引之后,马上就又能取到数据了。
这是索引有问题?还是索引损坏?还是其它的什么问题?
Close this Window Bookmark and Share This Page
Copy HTML:
If you like this then please subscribe to the RSS Feed.
![[Bloglines]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/bloglines.png)
![[co.mments]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/comments.png)
![[del.icio.us]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/digg.png)
![[diigo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/diigo.png)
![[Facebook]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/facebook.png)
![[Furl]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/furl.png)
![[Google]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/google.png)
![[MySpace]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/myspace.png)
![[Reddit]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/reddit.png)
![[Rojo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/rojo.png)
![[Slashdot]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/technorati.png)
![[Windows Live]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/email.png)
September 25th, 2007 at 23:47:01
一直看你的博客, 受益良多, 却几乎没有留言, 趁这个中秋佳节, 顺道带个祝福, 中秋快乐表示谢意!
[Reply]
September 26th, 2007 at 0:26:25
谢谢,也祝你中秋愉快!国庆快乐!
[Reply]