hisoka Posted May 14, 2015 Share Posted May 14, 2015 I read about sql group by clause but I could not understand what it really means and what it does . I would like to know what it is in simple words and what it does ? Link to comment Share on other sites More sharing options...
Ingolme Posted May 14, 2015 Share Posted May 14, 2015 Did you read the tutorial page? http://www.w3schools.com/sql/sql_groupby.asp Link to comment Share on other sites More sharing options...
hisoka Posted May 17, 2015 Author Share Posted May 17, 2015 yes . It was the first tutorial I read before I posted my message . However I could not understand the group by clause Link to comment Share on other sites More sharing options...
Ingolme Posted May 17, 2015 Share Posted May 17, 2015 I don't really know how to put it simpler than it is in the tutorial. If you have multiple rows with the same value, you use GROUP BY to only return one result with that value. Aggregate functions can be used to operate with the values of all the rows that have been grouped. Link to comment Share on other sites More sharing options...
hisoka Posted May 18, 2015 Author Share Posted May 18, 2015 "If you have multiple rows with the same value" I cannot see in the link you gave me : http://www.w3schools...sql_groupby.asp any table that has two rows with the same value !!! Link to comment Share on other sites More sharing options...
Ingolme Posted May 18, 2015 Share Posted May 18, 2015 They're not showing all the records in the database table on that page, they only show three from each table.Most likely, in the orders table there are multiple different orders with the same ShipperID. Link to comment Share on other sites More sharing options...
hisoka Posted May 19, 2015 Author Share Posted May 19, 2015 "If you have multiple rows with the same value, you use GROUP BY to only return one result with that value" is it the function of GROUP BY clause ? what if we have multiple rows with different values, do we use GROUP BY to return only one result ?? 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