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
What is the difference between NOROW and LOCKROW?
What is the full meaning of dml?
What are the triggers in sql?
Explain a join?
How to delete existing triggers using "drop trigger"?
Tell me about builtinadministrator?
How to use column default values in insert statements in ms sql server?
How to apply cascading referential integrity in place of triggers?
What are the dmvs?
Can you name a few encryption mechanisms in sql server?
What are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
What is sql server profiler trace data file?
What is identity?
What is index, cluster index and nonclustered index?
What is an expensive query?