分享

Informix select 语句总结...

 昵称90415 2009-02-25
Informix select 语句总结
 
作者:fdmtdmcdm  出处:fdmtdmcdm.cublog.cn  更新时间: 2007年02月08日 
----select语句总结----

--以column1排序进行查询,也可以以多个字段进行排序,如order by column1,column2,默认是升序,降序用desc
select * from table where column>1 order by column1 
--把查询结果放到临时表temptable中
select column1 from table where colunm2<2 into temp temptable
--把字段column1放到变量var中
select colunm1 into var from table
--过滤出column2字段有两条以上的记录
select column2,count(*) from table
group by 1 having count(*)>1
--排除重复的行
select distinct column1 from table
select unique column1 from table
--时间函数
select day(time_stamp) from table
返回日期中的天
select day(current) from table
 
 
----与时间有关----
 
day(current)表示当天(只列出天数)
year(current)显示年份
month(current)显示月份
date(current)显示当天(年月日)
weekday(current)显示星期几
--此处的current可用today代替,如year(today)
select current year to day  from table
current year to month 显示年月
current year to day 显示年月日
current year to hour显示年月日小时
current year to minute显示年月日小时分
current year to second 显示年月日小时分秒
限制时间,显示年到秒
--extend(time_stamp,year to second)
限制时间,显示年到月
--extend(time_stamp,year to month)
 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多