Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How to find all DB objects that has particular column name ?
Hi,[code] SELECT table_name, column_name FROM user_tab_columns WHERE upper(column_name) LIKE upper('%Last_Name%'); [/code]this in Oracle
Hi,
[code]
SELECT table_name, column_name
FROM user_tab_columns
WHERE upper(column_name) LIKE upper(‘%Last_Name%’);
[/code]
this in Oracle
See lessneed query to display ‘job’ & their counts & then display the no. of distinct ‘dept no’ under each ‘job’ & their counts ?
Hi,[code]SQL> select job, count(*) from scott.emp group by job order by 1;[/code]JOBCOUNT(*)ANALYST2CLERK4MANAGER3PRESIDENT1SALESMAN4 5 rows selected.[code]SQL>select job, count(distinct deptno), count(*)from scott.empgroup by joborder by 1;[/code]JOBCOUNT(DISTINCTDEPTNO)COUNT(*)ANALYST12CLERKRead more
Hi,
[code]
SQL> select job, count(*)
from scott.emp
group by job
order by 1;
[/code]
[code]
SQL>select job, count(distinct deptno), count(*)
from scott.emp
group by job
order by 1;
[/code]
[code]
select job, deptno, count(*)
from scott.emp
group by job,deptno
order by 1,2;
[/code]
In order to put that in a PLSQL procedure, for each SQL you can do
set serverout on
[code]
begin
for i in ( “yoursql” )
loop
dbms_output.put_line( “attributes” );
end loop;
end;
[/code]
hope this help.
See less