Skip to content

SQL 常用命令 #7

Description

@OnedayLiu

查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断

select * from people  where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)  ;

查询某个字段的条数

SELECT count(*) as count FROM push_record WHERE create_time BETWEEN "2018-03-28 00:00:00" and "2018-03-28 23:59:59";

按天查询

SELECT COUNT(*) AS push_num, create_time
FROM push_record
GROUP  BY DATE_FORMAT(create_time, '%Y%m%d')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions