skip to main
|
skip to sidebar
Oracle Juggernath
Saturday, August 18, 2012
write a function to return the count of rows in a table by passing table name as parameter......
create or replace function tab_count(p_table varchar2) return pls_integer
as
v_cnt pls_integer;
begin
execute immediate 'select count(1) from '||p_table into v_cnt;
return v_cnt;
end tab_count;
/
Swap YES,NO values in a table column with single update statement.....
update a set status=(case when status='YES' then 'NO'
when status='NO' then 'YES'
end)
We can write select query in this way also....
select
(select count(*) from a),
(select count(*) from b),
(select count(*) from a,b)
from dual
How to get counts of first table ,second table and both tables in a join in single query?
select
(select count(*) from a),
(select count(*) from b),
(select count(*) from a,b)
from dual
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)
About Me
Seshagiri Dama
I have been working as PL/SQL developer since 2005. I am passionate about oracle performance tuning. I am Oacle 10g DBA certified associate.
View my complete profile
Blog Archive
▼
2012
(19)
►
September
(1)
▼
August
(4)
write a function to return the count of rows in a ...
Swap YES,NO values in a table column with single u...
We can write select query in this way also....
How to get counts of first table ,second table and...
►
February
(14)
►
2011
(8)
►
September
(4)
►
August
(4)
►
2009
(6)
►
June
(3)
►
May
(3)