Ankit  Shukla

Ankit Shukla

  • NA
  • 681
  • 116.4k

group by and where

Aug 4 2015 8:01 AM
I have a table like this:
 
table name: Student
 
  Trade    |   session     | Student
 -----------|----------------|-----------
      CS      | 2015-2016 | Ankit
      CS      | 2015-2016 | Qwen
      IT       | 2015-2016 | ABC
      IT       | 2016-2017 | Ram
      IT       | 2016-2017 | Sam
 
 I want to fetch trade with   total student  where Session = @Session
 
Ex: if  session =2015-2016 
  Output:    
 
Trade |Student
--------|------------
  CS    | 2
 IT      | 1
 
 
Thanks in advance 

Answers (3)