CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  .NET技术 >  ASP.NET

再问几个查询语句的问题,100分

楼主ray88(ray88)2004-12-03 08:44:01 在 .NET技术 / ASP.NET 提问

SELECT   Items.Name,   Books.ISBN,   Authors.Name   AS   Authors,Items.UnitPrice   FROM   Authors   INNER   JOIN   BookAuthor   ON   Authors.PKId   =   BookAuthor.AuthorId   INNER   JOIN   Books   ON   BookAuthor.ItemId   =   Books.ItemId   INNER   JOIN   Items   ON   Books.ItemId   =   Items.PKId   WHERE   (Items.Name   ='abc')  
   
  SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice   FROM   Items   INNER   JOIN   Authors   ON   Authors.PKId   =   Items.PKId   WHERE   (Authors.Name   like   '%abc%')  
   
  SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice   FROM   Items   INNER   JOIN   Books   ON   Items.PKId   =   Books.ItemId   WHERE   (Books.ISBN   ='')  
   
  哪位大哥帮忙转成acess数据库的查询语句,万分感谢 问题点数:0、回复次数:12Top

1 楼jackymi(完美刺客)回复于 2004-12-03 08:48:44 得分 0

access不支持sqlTop

2 楼landlordh(work wonders)回复于 2004-12-03 08:49:43 得分 0

以上應該可以去掉()  
  不行的話,試下這個  
   
  SELECT   Items.Name,   Books.ISBN,   Authors.Name   AS   Authors,Items.UnitPrice   FROM   Authors,BookAuthor,Books,Items   where   Authors.PKId   =   BookAuthor.AuthorId   and   BookAuthor.ItemId   =   Books.ItemId   and   Books.ItemId   =   Items.PKId   and   Items.Name   ='abc'  
   
  SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice   FROM   Items,Authors   where     Authors.PKId   =   Items.PKId   and   Authors.Name   like   '%abc%'  
   
  SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice   FROM   Items,Books   where     Items.PKId   =   Books.ItemId   and   Books.ISBN   =''  
  Top

3 楼zhanqiangz(闲云野鹤-Overriding)回复于 2004-12-03 08:57:57 得分 0

sql是一种表中,虽然不能数据库产品可能会有差异,但是access一样支持sql.用where连接试试。  
  SELECT   Items.Name,   Books.ISBN,   Authors.Name   AS   Authors,Items.UnitPrice   FROM   Authors   ,BookAuthor,item   ,books   where   Authors.PKId   =BookAuthor.AuthorId   and   BookAuthor.ItemId   =   Books.ItemId   and   Books.ItemId   =   Items.PKId   and   Items.Name   ='abc'  
  Top

4 楼zhanqiangz(闲云野鹤-Overriding)回复于 2004-12-03 08:59:07 得分 0

SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice   FROM   Items   ,Authors   where   Authors.PKId   =   Items.PKId   and   Authors.Name   like   '%abc%'  
  Top

5 楼zhanqiangz(闲云野鹤-Overriding)回复于 2004-12-03 08:59:56 得分 0

SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice   FROM   Items   ,   Books   where   Items.PKId   =   Books.ItemId   and   Books.ISBN   =''  
   
  Top

6 楼johnsuna(缘来是e)回复于 2004-12-03 08:59:57 得分 0

SELECT   Items.Name,   Books.ISBN,   Authors.Name   AS   Authors,Items.UnitPrice   FROM   Authors   a,BookAuthor   ba,Books   b,Items   i   where   a.PKId   =   ba.AuthorId     and   ba.ItemId   =   b.ItemId   and   b.ItemId   =   i.PKId   WHERE   i.Name   ="abc"  
   
  SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice   FROM   Items,Authors   where   Authors.PKId   =   Items.PKId   and   Authors.Name   like   "%abc%"  
   
  SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice   FROM   Items,Books   where   Items.PKId   =   Books.ItemId   and   Books.ISBN   =""Top

7 楼litp(天道酬勤)回复于 2004-12-03 09:04:08 得分 0

access当然支持sql  
   
   
  SELECT   Items.Name,   Books.ISBN,   Authors.Name   AS   Authors,Items.UnitPrice    
  FROM   Authors   ,BookAuthor,Books,Items  
  where   (Authors.PKId   =   BookAuthor.AuthorId)   and   (BookAuthor.ItemId   =   Books.ItemId)    
  and   (Books.ItemId   =   Items.PKId)   and   (Items.Name   ='abc')  
   
   
  SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice    
  FROM   Items   ,Authors  
  where   Authors.PKId   =   Items.PKId   and   Authors.Name   like   '%abc%'  
   
   
   
   
   
   
  SELECT   Items.Name,   Items.ImageFileSpec,   Items.UnitPrice    
  FROM   Items   ,   Books    
  where   Items.PKId   =   Books.ItemId   and   (Books.ISBN   ='')Top

8 楼lily4064(忘忧草)回复于 2004-12-03 09:08:00 得分 0

呵呵,改成这样的。  
  select   Items.Name,books.ISBN,Authors.Name   as   Authors,Items.Unitprice   from   Authors,BookAuthor,books,Items   where   Authors.PkId=BookAuthor.AuthorId   and   BookAuthor.ItemId=Books.ItemId   and   Books.ItemId=Items.PKId   and   Items.Name='abc'  
   
  select   Items.Name,Items.ImageFileSpec,Items.UnitPrice   from   Items,Authors   where   Authors.PkId=Items.PkId   and   Authors.Name   like   '%abc%'  
   
  select   Items.Name,Items.ImageFileSpec,Items.unitprice   from   Items,Books   where   Items.PkId=Books.ItemId   and   Books.ISBN=''Top

9 楼dragonforfly(飘零)回复于 2004-12-03 09:13:03 得分 0

Access支持SQL,我以前用Access和VBA编程的,SQL   Server的SQL语句直接复制过去,改动一点就可以用了,有时都不需要改动.  
  你复制到Access里慢慢调试吧Top

10 楼nhf80649(懒星星)回复于 2004-12-03 09:44:34 得分 0

SELECT   Items.Name,   Books.ISBN,   Authors.Name   AS   Authors,Items.UnitPrice   FROM   Authors   INNER   JOIN   BookAuthor   ON   Authors.PKId   =   BookAuthor.AuthorId   INNER   JOIN   Books   ON   BookAuthor.ItemId   =   Books.ItemId   INNER   JOIN   Items   ON   Books.ItemId   =   Items.PKId   WHERE   (Items.Name   ='abc')  
   
  SELECT   Name,   ImageFileSpec,   UnitPrice   FROM   Items   INNER   JOIN   Authors   ON   Authors.PKId   =   Items.PKId   WHERE   (Authors.Name   like   '%abc%')  
   
  SELECT   Name,   ImageFileSpec,   UnitPrice   FROM   Items   INNER   JOIN   Books   ON   Items.PKId   =   Books.ItemId   WHERE   (Books.ISBN   ='')  
   
   
  直接就可以的~~~  
  Top

11 楼snowpine999([彼岸烟花][当你看到☆河灿烂,可会想起我?])回复于 2004-12-03 10:02:19 得分 0

access和sql  
  都是微软的东东吧     怎么可能不支持?Top

12 楼YapEro([::q^-^p::])回复于 2004-12-03 11:50:52 得分 0

这些语句在access中直接就可以用啊.  
  sql和access只是日期数据类型时有些不同,其他语法都是一样.另外sql比access多了些函数Top

相关问题

  • 问查询语句
  • 查询语句的问题
  • sql查询语句问题!
  • 查询语句问题,急?
  • sql语句查询问题
  • 查询语句问题
  • sql查询语句问题?
  • 子查询语句问题?
  • 查询语句的问题
  • 查询问题(sql语句)

关键词

  • 语句
  • access
  • sql
  • pkid
  • bookauthor
  • imagefilespec
  • itemid
  • unitprice
  • items
  • authors

得分解答快速导航

  • 帖主:ray88

相关链接

  • CSDN .NET频道
  • .NET类图书
  • C#类图书
  • .NET类源码下载

广告也精彩

反馈

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