Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有2张桌子A,B是这样的:
A.id A.created ---- B.id B.data B.aId
我想选择所有B.data符合以下条件的:
B.data
A.created
B.aId
A.id
我的理解是我可以通过使用子查询来解决这个问题,但我怀疑这是 JOIN 语句的情况。如果是这样,我真的很想看看它是如何完成的 :)
谢谢!
select * from A join B on A.id = B.aId where A.created is not null
select * from A inner join B on A.id = B.aId and A.created is not null