mysql中查询语句中 as amount 是什么意思???

来源:百度知道 编辑:UC知道 时间:2024/06/18 17:55:35
谁能详细解释一下这几句的意思?
$sql="select count(*) as amount from user order by UID asc";
$result=mysql_query($sql);
$row=mysql_fetch_row($result);
$amount=$row['amount'];

其中不懂的地方是count(*)
as amount
还有最后一句。
希望能在详细一点

select count(*) as amount from user order by UID asc
以降序的方式(asc)查询user表里字段为UID的值的数目(count(*)),返回的结果存在别名 amount 里.

count(*) as amount 是给count(*)的结果取一个名字
术语叫别名.

查询COUNT表里面的所有信息 按用户UID列举出所有用户