The where clause of SQL, and haveing the difference between clause

Users questions:where clause and having clause of the use of similar but different, I really do not understand how to use!!!!
Experts answer:where record is limited conditions, having a group of records is limited conditions. So we do not have no access to having groupby; Used groupby can also be used with where having. groupby is based on the specified field, several records have the same value combined into one. Like, the database has a table keep student achievement called "transcript", which has (class, student number, math, language) In four fields, according to the class as the unit is now seeking the mathematical average of each class is to select classes, avg (math) from transcripts groupby class if you want to know the language scores for each class of more than 80 people in the mathematical average scores, then use the where, becauseCondition of individuals in the study, equivalent to first select out all the class results in all languages in more than 80 people, on these people by class group, do math scores of avg. Written in select classes, avg (math) from transcripts where language 80groupby language class if you want to know the average score of 90 points or more in math class average, having to use it, because this condition is to evaluate the entire class, and is equivalent to press the record class is divided into several group, and then see whether the language of each groupWen average 90 or more classes to meet this having a mathematical average will be displayed. Written in select classes, avg (math) from transcripts groupby class havingavg (Chinese) 90 2 can be used together, ah, such as writtenselect classes, avg (math) from transcripts where the language 80groupby class havingavg (language) 90 is equivalent to first language is more than 80 people to find, and then grouped according to their class, look at each class on which to write language in 80The average person not assigned to 90, with more than 80 students in the class average score are lower than the 90 classes, math classes such as average do not want to know. In fact, having read and write select the location to reflect this treatment also has the feel of a follow on from the backThan groupby priority; another first groupby the write.
  • This information provided by the users.Thanks!