Submitted Questions

  • 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...

    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.