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

tell me what is blocking and how would you troubleshoot it? : Sql server database administration

475


What is the contrast between sql and mysql?

587


What is the difference between a local and a global temporary table?

614


Explain the difference between delete,drop and truncate in SQL Server?

587


You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?

539






What are subqueries in sql server? Explain its properties.

534


What are the properties of sub-query?

572


How to attach adventureworkslt physical files to the server?

623


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...

1566


Can you change the data type of a column in a table after the table has been created? If so, which command would you use?

629


Can You Use A Stored Procedure To Provide Data To An Ssrs Report?

109


What is the full form of ddl?

499


What is difference between delete and truncate commands?

521


Explain system views?

574


Do you know what is difference between index seek vs. Index scan?

509