数据库

本类阅读TOP10

·SQL语句导入导出大全
·SQL Server日期计算
·SQL语句导入导出大全
·SQL to Excel 的应用
·Oracle中password file的作用及说明
·MS SQLServer OLEDB分布式事务无法启动的一般解决方案
·sqlserver2000数据库置疑的解决方法
·一个比较实用的大数据量分页存储过程
·如何在正运行 SQL Server 7.0 的服务器之间传输登录和密码
·SQL中两台服务器间使用连接服务器

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
一条SQL语句

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

以前没见过。。。
数据库这一块这是大啊。。。

select distinct y.cid from orders x, orders y where y.pid = x.pid and x.aid = 'a06';
                                      ~~~~~~~~~~~~以前没见过同一个表 两次

原来要实现的目的是:
Get cid values of customers who order a product for which an order is also placed by agent a06.
                                                                                                           ~~关键就是这个词了
ps:几个表
CUSTOMERS cid cname city discnt
PRODUCT pid pname city quantity price
AGENTS  aid aname city percent
ORDERS ordno month cid aid pid qty dollars



相关文章

相关软件