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.
我有一个包含几个表的数据库。我想构建一个查询,检查一个表中是否存在记录,并根据记录是否存在执行或不执行另一个表的条件。我将如何构建这样的查询?
您没有详细说明您需要执行的测试,但看起来您需要构建一个 PL/SQL 块来实现您的目标。
就像是
DECLARE pnum_cnt NUMBER; BEGIN SELECT COUNT(*) INTO pnum_cnt FROM YOUR_TABLE; IF (pnum_cnt > 0) THEN -- Perform the other test END; END;