各位老鸟,能不能根据你们的经验说说索引,别名有什么用处
知道一点,就是感觉自己认识不是太深 问题点数:100、回复次数:7Top
1 楼sandyde2(sandy)回复于 2003-11-01 18:29:41 得分 40
index can increse the searching speed. sometimes 20 times faster.
alias just shorten the sql statement.Top
2 楼guhuan(水云间)回复于 2003-11-01 18:38:20 得分 0
用中文好吗
谢谢Top
3 楼bombshell(水中鱼)回复于 2003-11-01 19:07:27 得分 20
用别名可以使sql语句更清晰,书写更简洁、方便。Top
4 楼guhuan(水云间)回复于 2003-11-02 17:07:24 得分 0
还是不懂
能举个例子吗?Top
5 楼sandyde2(sandy)回复于 2003-11-02 17:40:02 得分 40
alias:
suppose you have two tables.
T001_user_information(id, firstname,secondname,...)
T002_business_information(id, firstname, secondname, ...)
now select id when user and business has the same firstname and secondname, just for testing.
if you do not use alias, it would be
select T001_user_information.id, T002_business_information.id
from T001_user_information, T002_business_information
where T001_user_information.firstname=T002_business_information.firstname
and T001_user_information.secondname=T002_business_information.secondname
if you use alias, it would be
select t1.id, t2.id
from T001_user_information t1, T002_business_information t2
where t1.firstname=t2.firstname
and t1.secondname=t2.secondname
just a bit short. nothing else
Top
6 楼guhuan(水云间)回复于 2003-11-03 10:58:35 得分 0
先谢谢你的回答:
楼上讲的是别名吧
难首别名的作用只是为了书写方便吗
其它索引的作用呢,是不是为了查找Top
7 楼guhuan(水云间)回复于 2003-11-12 20:17:10 得分 0
请大家继续发表大见Top




