473,748 Members | 7,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

URGENT..!!!!! Can any 1 Give me query for this pls?

2 New Member
EmpNo DeptNO
2001 10
2002 20
2003 30
2004 20
2005 10
2006 30
2007 20
2008 10
2009 30
2010 30
2011 20
2012 30

GUYS I WANT FOLOWING OUTPUT

COUNT DEPTNO
3 10
4 20
5 30

can some1 pls give me Oracle SQl query to count the frequency of a value in a column...
output should have all distinct value of that column and total number(frequenc y) the value appears in the colum.

any help is greatly appreciated
thanks
vishal
Jul 26 '07 #1
1 1240
maured
2 New Member
select count(*) , deptno from <table name> group by deptno

ciao
Jul 26 '07 #2

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.