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 / hanamesh havale
select top 10 cast(key as varchar)
+ '(' + cast(count(key) as varchar) + ')'
from TableName
group by key
Hanamesh Havale
Influx Infotech
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration
Do you know what are acid properties of transaction?
What is a raid and what are different types of raid configurations?
What are the restrictions while creating batches in sql server?
What are the fixed server level roles? : sql server security
How check triggers in sql server?
Which database stores information about replication?
What is use of @@ spid in sql server?
How do you create type- insensitive operator?
What are sparse columns?
Explain powershell included in sql server 2008?
In my application I have a process which picks the scanned files (tif format) from a shared location and it links to application and shown on it.The actuall issue is that my process picks the file before it is completly written or scanned which results in displaying few parts of the image or incomplete image.I need to check if the file is not completly scanned or written then do not link it to application.Please help if any body tell me that how can i check that file is in written phase or locked through DTS.thanking you in advance
Can you pass expressions to function parameters?
What is sql or structured query language?
What is indexing and its types?