Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUM on a group

Status
Not open for further replies.
Jun 12, 2009
123
GB
Hi All,

I have 2 select statements (4 fields in the select statement)and then applied a union. Field 1 is the unique refid, so for example ref1 everything is the same apart from field 4, where the amounts are different.

How do I sum these and bring back one row?

Many Thanks
 
Since you have provided no information about the underlying tables, their contents, the SQL you have attempted to use, and any error messages that you may be receiving, the answer to your question is "I have no idea."

Do you feel inclined to give us some more information, or should we start a guessing competition?

Regards

T
 
It would be much easier to help you if you would include (1) the queries and (2) a sample of your data. Based on what you have provided, you would sum on a subset of columns, eliminating any column that has more than one value in it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top