- Where Developers Learn, Share, & Build Careers
This is a common problem, and I'm not sure if here's the problem here:
= & Gt;
Explanation:
- A ticket falls under one attendance
- There is a revenue receipt
- Get the total revenue by section and need.
- This double is present in the calculation because 2 tickets can be related to that same presence, thus in double counting I want to get the sum of revenue, but only want to count the attendees once.
In my SQLFlash example, I want to see:
section | Total_re venue ------------------------ a. 40 & lt; = 40 is correct, but I'm getting 50 ... b. Zero C | 40
I want to solve it without the use of sub-queries. I need a scalable solution that gives me the same query in different columns on different columns Will allow this to happen. So whichever one allows me to accomplish this, I am open to suggestions.
Thank you for your help.
here
row_number () :
Select section is a version using zodiac (revenue) t. Section, A.View, Route_Number (), (Division A by AED, T. order order by AID), select Tickets from RT, join TATand_ID = AID people who are present) src where RN = 1 group by section order by section;
View
Comments
Post a Comment