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
1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do
What is difference between standardization and normalization?
How will you go about resolving deadlocks?
Explain an incremental backup?
What is an indexing technique?
What is the difference in accessing db between sql server vs sql azure?
Is the order of columns in the set clause important in ms sql server?
What is the difference between coalesce() & isnull()?
What does it mean to normalize data?
What are the types of user defined functions in sql server?
What are the rendering extensions of ssrs?
What is the language structure to add a record to a table?
List some major differences between triggers and stored procedures?
Mention the differences between having and where clause.
What information is maintained within the msdb database?