Query-Related Issues statement produces two counts. The first is a count of the number of rows in the table, and the second is a count of the number of non- NULL  values in the  age  column: mysql>  SELECT COUNT(*), COUNT(age) FROM person; For some data types, MySQL handles  NULL  values specially. If you insert  NULL  into a  TIMESTAMP  column, the current date and time is inserted. If you insert  NULL  into an integer or floating-point column that has the AUTO_INCREMENT  attribute, the next number in the sequence is inserted. An alias can be used in a query select list to give a column a different name. You can use the alias in GROUP BY ,  ORDER BY , or  HAVING  clauses to refer to the column: Standard SQL disallows references to column aliases in a  WHERE  clause. This restriction is imposed because when the  WHERE  clause is evaluated, the column value may not yet have been determined. For example, the following query is illegal: The  WHERE  clause determines which rows should be included in the  GROUP BY  clause, but it refers to the alias of a column value that is not known until after the rows have been selected, and grouped by the GROUP BY . In the select list of a query, a quoted column alias can be specified using identifier or string quoting characters: Elsewhere in the statement, quoted references to the alias must use identifier quoting or the reference is treated as a string literal. For example, this statement groups by the values in column  id , referenced using the alias  ‘a‘ : SELECT id AS ’a’, COUNT(*) AS cnt FROM  tbl_name GROUP BY ‘a‘; SELECT 1 AS ‘one‘, 2 AS ’two’; SELECT id, COUNT(*) AS cnt FROM  tbl_name WHERE cnt > 0 GROUP BY id; This statement groups by the literal string  ’a’  and does not work as you may expect: SELECT id AS ’a’, COUNT(*) AS cnt FROM  tbl_name GROUP BY ’a’; If you receive the following message when trying to perform a  ROLLBACK , it means that one or more of the tables you used in the transaction do not support transactions: Warning: Some non-transactional changed tables couldn’t be rolled back These nontransactional tables are not affected by the  ROLLBACK  statement. If you were not deliberately mixing transactional and nontransactional tables within the transaction, the most likely cause for this message is that a table you thought was transactional actually is not. This can 5310 B.3.4.4 Problems with Column Aliases B.3.4.5 Rollback Failure for Nontransactional Tables SELECT SQRT(a*b) AS root FROM  tbl_name GROUP BY root HAVING root > 0; SELECT id, COUNT(*) AS cnt FROM  tbl_name GROUP BY id HAVING cnt > 0; SELECT id AS ’Customer identity’ FROM  tbl_name ;