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.
SELECT pid,cid,product_id,thickness FROM products WHERE thickness <> ""; SELECT cid,level,thickness FROM catalog WHERE thickness <> "";
所有 pid 都映射到 cid。我只对 2 级映射感兴趣。
目标,我想知道哪些产品在两个目录产品中的厚度值不同。请注意,产品通过 cid 附加到一个类别,所有产品都附加到 2 级类别。
SELECT a.pid, a.product_ID FROM products a INNER JOIN catalog b ON a.cid = b.cid AND b.level = 2 WHERE a.thickness <> b.thickess