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 / madhu sudhan g
Hiiiii
Lets the table name is No1 having column A is of int data Type
Now the query is
select convert(nvarchar(5),A) + '(' +
convert(nvarchar(5),count(1))+')' from NO1 GROUP BY A
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain encryption of entire databases without the need for application changes in sql server 2008?
Explain foreign key in sql server?
What is the usage of sign function?
What is a mixed extent?
What is etl - extraction, transformation, and loading?
Which are the important points to note when multilanguage data is stored in a table?
How to filter records of table in SQL SERVER?
Can you pass expressions to stored procedure parameters?
Do you know the capabilities of cursors?
How to loop through returning rows?
how to use DTS package in 2000,2005,2008 in sql server
what is difference between NULL and ISNULL in SQL Server 2008?
What is a view and what are its advantages?
What are the differences between char and varchar in ms sql server?
Can a table have 2 foreign keys?