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

虾米问问题了,大米们留步拉!:)))()

楼主liuex1235(盲流)2006-03-04 14:18:21 在 Oracle / 基础和管理 提问

table1  
  product_no     product_id     prod_addr  
  table2  
  product_id       obj_id  
  table3  
  connect_id     connect_code  
  table4  
  phone_no     cust_id  
  table5  
  cust_id       cust_name  
  条件  
  where   table1.product_id=table2.product_id  
  table2.obj_id=table3.connect_id  
  table4.cust_id=table5.cust_id  
  table4.phone_no=table1.product.no  
  结果  
  table1.prod_addr           table1.product_no         cust_name           table3.connect_code  
  _________________       __________________       ___________       ____________________  
   
  select   a.prod_addr,a.product_no,c.connect_code,e.cust_name  
  where  
          a.product_id=b.product_id  
  and   b.obj_id=c.connect_id    
  and   d.cust_id=e.cust_id  
  and   d.phone_no=a.product_no  
  from   table1   a,table2   b,table3   c,table4   d,   table5   e      
   
  得到结果出现N条重复的记录  
  请问我写的这个查询问题在哪?  
  象是出现笛卡儿乘积现象。  
  如何改,谢谢了!  
  急等!            
   
  问题点数:20、回复次数:2Top

1 楼wffffc(飞)回复于 2006-03-04 14:35:31 得分 0

select   a.prod_addr,a.product_no,c.connect_code,e.cust_name  
  from   table1   a,table2   b,table3   c,table4   d,   table5   e    
  where  
          a.product_id=b.product_id  
  and   b.obj_id=c.connect_id    
  and   d.cust_id=e.cust_id  
  and   d.phone_no=a.product_no  
  这样试试看Top

2 楼liuex1235(盲流)回复于 2006-03-04 14:46:47 得分 0

select   a.prod_addr,a.product_no,c.connect_code,e.cust_name  
  from   table1   a,table2   b,table3   c,table4   d,   table5   e      
  where  
          a.product_id=b.product_id  
  and   b.obj_id=c.connect_id    
  and   d.cust_id=e.cust_id  
  and   d.phone_no=a.product_no  
   
  呵呵,不好意思,纠正一下!Top

相关问题

  • 大侠留步!
  • 壮士留步!
  • 同志留步!
  • 高手请留步!
  • 斑竹请留步!
  • 高手,请留步
  • 求救,高手请留步!!!!!!!!!!!!!!!
  • 各路英雄请留步~~:)
  • apache57(虾米) 请进
  • 高手请留步:留步:100分 。打印机的问题......

关键词

  • code
  • idand
  • cust
  • idtable
  • prod
  • product
  • phone
  • table
  • connect
  • addr

得分解答快速导航

  • 帖主:liuex1235

相关链接

  • Oracle类图书

广告也精彩

反馈

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