Quickest query to check for the existence of a row in Oracle?

后端 未结 4 1989
北荒
北荒 2021-02-05 22:31

I\'m using Oracle, and I have a very large table. I need to check for the existence of any row meeting some simple criteria. What\'s the best way to go about this using simple

4条回答
  •  抹茶落季
    2021-02-05 23:06

    begin
    select 'row DOES exist' 
      into ls_result
    from dual
    where exists (select null from x where x.col_a = value_a and x.col_b = value_b);
    exception
    when no_data_found then
      ls_result := ' row does NOT exist';
    end;
    

提交回复
热议问题