In a query statement with a group by clause, the columns specified in the select list are either columns specified in the group by clause or contain clustering functions.
Select clientmediatypeid, count (ID) from Table group by table. clientmediatypeid having clientmediatypeid> 30
When having clause is used in the gropu by clause, only groups meeting having conditions are returned in the query results. A SQL statement can contain the WHERE clause and having clause. Having is similar to the WHERE clause and is used to set conditions.
Select Table. Field, (case when table. cityid <= 50 then 'No'
When table. cityid> = 50 then 'rows 'else' unclear 'end) 'Case column name' from hj_allnews
Select Table. Field, (Case table. Username when 'zhangshan'then' doesn't work'
When 'Lee 4' then' line 'else' unclear 'end) 'Case column name' from hj_allnews
When case then is used, if case is followed by the when field in the table and then the specific value of the field, there cannot be an arithmetic expression. Alas, this is a waste of such a conference .. Tom