Adobe Community
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forÂ
ShowÂ
 onlyÂ
|
Search instead forÂ
Did you mean:Â
Global community
Language:
Deutsch
English
Español
Français
Português
日本語コミュニティ
Dedicated community for Japanese speakers
í•œêµ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Sign In
Exit
Home
ColdFusion
Discussions
Group By and Sum Issue
Home
ColdFusion
Discussions
Group By and Sum Issue
0
Upvote
Group By and Sum Issue
romeogq
Participant
,
/t5/coldfusion-discussions/group-by-and-sum-issue/td-p/465223
Oct 12, 2007
Oct 12, 2007
Copy link to clipboard
Copied
Can anyone please tell me how I can get the ins_id's to group so that the dollar amounts sum up properly? My SQL and current out put is listed below.
TOPICS
Advanced techniques
Views
470
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
cf_dev2
Guide
,
Oct 12, 2007
Oct 12, 2007
cf_dev2
•
Guide
,
Oct 12, 2007
Oct 12, 2007
Okay. Is this the correct formula?
sum(p.pur_quantity) * t.tic_rate
Would
sum(p.pur_quantity * t.tic_rate)
return the same/correct results?
Votes
0
Upvote
Translate
Translate
Jump to answer
5 Replies
5
Jump to latest reply
Dan_Bracuk
LEGEND
,
/t5/coldfusion-discussions/group-by-and-sum-issue/m-p/465224#M42296
Oct 12, 2007
Oct 12, 2007
Copy link to clipboard
Copied
Do inner joins instead of outer joins.
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
cf_dev2
Guide
,
/t5/coldfusion-discussions/group-by-and-sum-issue/m-p/465225#M42297
Oct 12, 2007
Oct 12, 2007
Copy link to clipboard
Copied
If you want the results grouped by INS_ID, why are you grouping by i.ins_id and t.tic_rate?
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
romeogq
AUTHOR
Participant
,
/t5/coldfusion-discussions/group-by-and-sum-issue/m-p/465226#M42298
Oct 12, 2007
Oct 12, 2007
Copy link to clipboard
Copied
In Response To cf_dev2
Thanks for the reply.
Dan,
I can't do all INNER JOINS because not all the instances have tickets, and not all the ticket records have purchase records.
cf_dev2,
The good ol' fashion 'aggregate function' error throws when tic_rate is not in the group by clause.
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Correct answer by
cf_dev2
Guide
,
/t5/coldfusion-discussions/group-by-and-sum-issue/m-p/465227#M42299
Oct 12, 2007
Oct 12, 2007
Copy link to clipboard
Copied
In Response To romeogq
Okay. Is this the correct formula?
sum(p.pur_quantity) * t.tic_rate
Would
sum(p.pur_quantity * t.tic_rate)
return the same/correct results?
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
romeogq
AUTHOR
Participant
,
/t5/coldfusion-discussions/group-by-and-sum-issue/m-p/465228#M42300
Oct 12, 2007
Oct 12, 2007
Copy link to clipboard
Copied
LATEST
DEE-DE-DEEEE!!!
LMAO, Thanks that was it. Wow.
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Post Reply
Preview
Exit Preview
never-displayed
You must be signed in to add attachments
never-displayed
Â
Resources
Documentation
ColdFusion User Guide