CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  其他数据库开发 >  MySQL/Postgresql

各位老鸟,能不能根据你们的经验说说索引,别名有什么用处

楼主guhuan(水云间)2003-11-01 11:35:21 在 其他数据库开发 / MySQL/Postgresql 提问

知道一点,就是感觉自己认识不是太深 问题点数: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

相关问题

  • 索引服务的用处
  • sql的别名
  • 别名问题
  • BDE别名,嘻~
  • BDE 别名
  • group by 的别名
  • 方法别名?
  • 一个很基础的查询时的别名问题,求老鸟帮忙了!
  • 索引
  • 索引

关键词

  • secondname
  • 别名
  • firstname
  • alias
  • business
  • information
  • user

得分解答快速导航

  • 帖主:guhuan
  • sandyde2
  • bombshell
  • sandyde2

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo