x

What percentage of male students were freshmen?

I need the query for this please help me! Here classification is a field and the data type is numeric. Classification: 1 =>Freshman 2=>Sophmore 3=>Unclassified 4=>Associate Degree 5=>Bachelor 6=>3rd Year Bachelor 7=>4th Year Bachelor

more ▼

asked May 15, 2013 at 06:10 AM in Default

avatar image

vijay559
0 2 2 3

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Select Classification ,count(Classification) ,CONVERT(DECIMAL(4,2),(Count(Classification) 100.0 / (Select Count() From YourTable))) as Percentage From YourTable Group By Classification

more ▼

answered May 15, 2013 at 08:52 AM

avatar image

ruancra
1.2k 31 38 46

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1208
x113

asked: May 15, 2013 at 06:10 AM

Seen: 760 times

Last Updated: May 15, 2013 at 08:52 AM

Copyright 2018 Redgate Software. Privacy Policy