if we have a column (Key) in a table.
and values of that column is
Key
1
1
1
2
2
3
3
4
4
5
5
5
and we want to show the data after query..like..

1(3)
2(3)
3(2)
4(2)
5(3)
how many times a single term comes..

Answer Posted / hitesh kumar vyas s

Take a example as to find the same student who got first and
second marks in each of sub.

SELECT RollNo,COUNT(Rank) FROM Student GROUP BY RollNo,rank
ORDER BY rank

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between DataRow.Delete() and DataRow.Remove()?

735


Please differentiate between a local and a global temporary table?

571


How to drop an existing table?

553


How to connect a database with sql express.?

568


How to generate create table script on an existing table in ms sql server?

643






What stored by the tempdb ? : sql server database administration

568


How much is a sql server license?

510


Does group by sort data?

513


What is inner join? Explain with an example?

690


what is a self join? Explain it with an example? : Sql server database administration

500


What are sub reports and how to create them?

99


What is the difference between cartesian product and cross join?

482


Are connections to sql server encrypted?

578


How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?

1578


Explain what are partitioned views and distributed partitioned views?

583