Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5833127
  • 博文数量: 671
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 7310
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-14 09:56
文章分类

全部博文(671)

文章存档

2011年(1)

2010年(2)

2009年(24)

2008年(271)

2007年(319)

2006年(54)

我的朋友

分类: Mysql/postgreSQL

2008-06-25 11:53:10

1、select DATE_FORMAT( NOW( ) , '%Y') as tyear,DATE_FORMAT( NOW( ) , '%m') as tmonth,
        DATE_FORMAT( NOW( ) , '%d') as tday,TIME_FORMAT(now() , '%H') as thour,DATE_FORMAT( NOW( ) , '%Y%m%d') as tymd,
        DATE_FORMAT( DATE_ADD(NOW( ), Interval -1 day), '%Y%m%d') as yymd,DATE_FORMAT( NOW( ) , '%Y%m%d%H') as now
 
2、"select n.name as hostname,
        u.`name` as owner ,
        u.`manager_username` as manager,
        u.`email` as mail,
        p.`name` as propertyname,
        s.`name` as sitename      
        from node as n
        inner join property as p
        inner join site as s
        inner join `groupNode_node` as g_n
        inner join `groupNode` as gn
        inner join user as u
        where gn.`gn_id` = g_n.`gn_id` and
        gn.`user_id` = u.`user_id` and
        g_n.`node_id`=n.`node_id` and
        s.`site_id` = n.`site_id` and
        p.`prop_id` = n.`prop_id` and  n.name = '".($hostname)."'"
 
3、"SELECT *
FROM traffic_colo_hourly
WHERE date <= DATE_FORMAT(NOW(),'%Y%m%d%H') and
      date > DATE_FORMAT( DATE_ADD(NOW(), Interval -7 day),'%Y%m%d%H') "
阅读(1410) | 评论(0) | 转发(0) |
0

上一篇:C Cpp IDE

下一篇:我的grub菜单

给主人留下些什么吧!~~