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 what is the difference between a local and a global temporary table?
What are the 3 types of schema?
What are the drawbacks of reporting in ssrs?
Is it possible to replicate data from sql server to oracle? : sql server replication
What is table constraint?
What is query cost in sql server?
what is the main function of a query parameter?
Explain ranking functions?
What is the command used to check locks in microsoft sql server?
Explain difference between control flow and data flow?
Does group by or order by come first?
What is user defined datatypes and when you should go for them?
Difference between drill down and drill through report.
How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?
How can sql injection be stopped? : sql server security