jys Posted May 7, 2007 Share Posted May 7, 2007 print only once for each group for example,result set having the following, fruits place consumption(tonnes) Mangoes UK 24 Tomatoes UK 33Tomatoes USA 30Apple UK 30 PineApple UK 12PineApple RSA 11 Now i want to sum up the consumption for each fruits,and print only once on report like the following. Mangoes 24 Tomatoes 63Apple 30 PineApple 23 Can anyone know the way to achieve this.if so,let me know . Link to comment Share on other sites More sharing options...
hingerl Posted May 8, 2007 Share Posted May 8, 2007 hi i think you SQL-Statment looks like: Code:SELECT fruits, place, consumption FROM table try this SQL-StatmentCode:[code]SELECT fruits, sum(consumption) as consumptionFROM tableGROUP BY fruits Link to comment Share on other sites More sharing options...
svenn Posted May 8, 2007 Share Posted May 8, 2007 I still think that tomatoes should be vegtables and not fruits.;) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now