如何显示超过3个出价的arcticle?

时间:2016-11-30 11:15:12

标签: mysql inner-join oracle-sqldeveloper where where-clause

The tables I use

我想显示所有出价超过3的articleName次。它也是Bids的编号。

我这样做了,但我真的不明白内心的联系。我理解它,以便内连接可用于连接每个表。

SELECT ArticleName, bidTime
FROM BID b inner join OFFER o
on b.OID = o.OID;
WHERE (bidTime- auctionEndDate) > 3;

1 个答案:

答案 0 :(得分:0)

要了解SQL JOINS,请参阅下面的文章: http://www.sql-join.com/sql-join-types/ 它以图形方式解释了连接,这是每个人都应该了解SQL的基础。

获取3次以上出价的优惠的查询

SELECT o.articleName
FROM offer o
INNER JOIN bid b on o.oid = b.oid
WHERE b.bidTime < o.auctionEndDate
group by o.oid, o.articleName
having count(b.bid) >= 3;