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 / neeraj

If the column name is key
select key,count(*) from jojo
group by key

simple

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is data source view or dsv? : sql server analysis services, ssas

548


Explain nested stored procedure. Syntax and an example for create nested stored procedure?

525


What is merge?

563


How do I manually uninstall an instance of sql server 2016?

539


How to list all stored procedures in the current database using ms sql server?

628






You want to check the syntax of a complicated update sql statement without executing it. What command should you use?

480


Explain about the command-line tool SQLCMD?

545


What is data compression?

542


What are synonyms?

522


What is difference between rownum and rowid?

502


Explain the steps needed to create a scheduled job?

519


What is t-sql script to take database offline – take database online.

596


Explain what is use of dbcc commands?

505


What is bookmark link in ssrs?

108


How many primary keys are possible in a table?

513