---
title: "查询最近7天的每天的注册人数"
author: "_yanbh"
date: "2015-12-24T10:16:00Z"
tags: []
slug: "7"
draft: false
lastmod: "2015-12-24T17:08:35Z"
id: 2266262
url: "https://yanbh.iteye.com/blog/2266262"
---

查询最近7天的每天的注册人数

select to char(li.create\_date,'yyyy-mm-dd') 日期,count(\*) 总数

from ptb\_login\_info li

where li.create\_date&gt;=trunc(sysdate)-7

and li.create\_date&lt;trunc(sysdate)

group by tochar(li.create\_date,'yyyy-mm-dd')

order by tochar(li.create\_date,'yyyy-mm-dd')