请教一句关于SQL语句中的select from as的问题

select ano,title,to_char(post_time,'yyyy-mm-dd') as post_time,smallimg,description,context,source_name,source_url from rz_article

请教一下这句SQL语句是什么意思?

查询表rz_article里的ano,title,post_time,smallimg,description,context,source_name,source_url字段记录集

to_char(post_time,'yyyy-mm-dd') as post_time

to char 是把日期或数字转换为字符串
as意思是to_char(post_time,'yyyy-mm-dd')这个函数结果,名称重命名。。。
意思是下面可以直接用post_time来读取to_char(post_time,'yyyy-mm-dd')这个结果,,面不是直接读取字段post_time的结果。。。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-03-27
select ano,title,to_char(post_time,'yyyy-mm-dd') as post_time /* 将post_time 这列由时间类型,转成年-月-日的字符型,之后再讲此列命名为 post_time 。as 就是将列名重命名*/,smallimg,description,context,source_name,source_url from rz_article

第2个回答  2015-03-27
从rz_article表中查那几个字段,其中post_time给to_char了,而且,显示的别名改为post_time(若不用as改别名,则在结果集显示的表头是to_char(post_time,'yyyy-mm-dd')
第3个回答  2015-03-27
查询rz_article表中的ano,title,post_time,smallimg,description,context,source_name,source_url字段,其中将post_time格式化为'yyyy-mm-dd'格式并输出为post_time
第4个回答  2015-03-27
as后的post_time是作为别名显示用的。如果没有别名,那么这一栏的标题就是很长一串。