select count(*)
from cols
where table_name = 'YOURTABLE'
and column_name = 'NAME2'
------------------------------
注意,需要大写
from cols
where table_name = 'YOURTABLE'
and column_name = 'NAME2'
------------------------------
注意,需要大写
int li_count;
begin
select count(*) into li_count
from tab_temp
where A = 'name2'
if li_count > 0 then
name2存在于表中
end if;
end;
int li_count
begin
select count(*) from yourtablename where a = 'NAME2';
if li_count > 0
begin
dbms_output.putline('name2存在')
endif
end