GeekInterview.com
Series: Subject: Topic:
Question: 16 of 279

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
Asked by: gaurvitul | Member Since Mar-2012 | Asked on: Mar 12th, 2012

View all questions by gaurvitul

Showing Answers 1 - 1 of 1 Answers
raghavender

Answered On : 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.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.