欢迎光临
我们一直在努力

一条SQL语句-数据库专栏,SQL Server

建站超值云服务器,限时71元/月

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

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

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 一条SQL语句-数据库专栏,SQL Server
分享到: 更多 (0)

相关推荐

  • 暂无文章