Using distinct keyword with the analytical functions

Hi
I have to write a query to fetch 5 columns from the data. columns are title,description,msgs_count,alerts and severity.
msgs_count is count(title) over (partition by ) and alerts is sum(title partition by) over.
in case the duplicates of title are present in data. I want the title to come only once in the output but the msgs_count and alerts must not be affected. is it possible?? if not then tell me an alternate to it plz

Questions by gaurvitul

Showing Answers 1 - 3 of 3 Answers

raghavender

  • Oct 7th, 2012
 

Analytic functions are used to fetch all rows with the required aggregate data, if duplicates are needed, then you can use distinct or you can use group by clause instead of analytic functions which will have better performance.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions