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.
有人可以告诉我以下场景的 sql 查询吗,
我想要来自 C 的所有数据,其中 A=123,B=212。
我怎样才能得到数据?你可以举任何例子并解释它,只是这3个表应该相互关联(即它应该有外键),并且查询应该使用连接。
提前致谢。
像这样的东西怎么样
SELECT c.* FROM TableC c INNER JOIN TableB b ON b.CID = c.ID INNER JOIN TableA a ON a.BID = b.ID WHERE a.ID = 123 AND b.ID = 212