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.
我有两种看法:
view1 view2 obj obj attribute +-+ +-+--+ |A| |C|27| +-+ +-+--+ |B| +-+ |C| +-+
如何组合这些值并返回输出,
obj attribute +-+--+ |A| 0| +-+--+ |B| 0| +-+--+ |C|27| +-+--+
用 0 作为 SQL 中的默认值?我不想使用 PL/SQL。
SELECT v1.obj, NVL(v2.attribute, 0) FROM view1 v1 LEFT JOIN view2 v2 on v1.obj = v2.obj