table test Field Type Null Key Default Extra id int(11) NO PRI NULL auto_increment name char(50) NO NULL age int(11) NO NULL school char(50) YES NULL (一)AVG()函数 AVG()通过对表中行数计数并计算特定列值之和,从而求得该列的平均值. 例如:SELECT AVG(age) AS avg_age FROM test…
count 用法 求总条数 $sql="select count(*) as total from e_user"; $query = mysql_query($sql, $link); $res = mysql_fetch_array($query); $count = $res['total']; max用法 $sql="select max(id) as maxid from e_user"; $sql="select id as maxid fro…