sql

1
2
3
4
5
6
7
8
SELECT cc.nick_name ,cc.user_name, max(ss.login_time) ,count(*)  as  login_count FROM `sys_logininfor`  ss, sys_user  cc
where ss.`status`=0
and  ss.login_time >= '2024-01-01'
and ss.login_time<='2024-01-31'
and  ss.user_name=cc.user_name
group by  cc.nick_name
ORDER BY login_count DESC
limit 10;

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
select
(select sum(fetch_data_count) from dacs_fetch_data_import_record)  as tj_datacl,
(SELECT  count(distinct cc.province) 
FROM `dacs_station` cc )  as tj_province , 
 
(SELECT  count(*)     FROM `dacs_station`  )  as tj_stationed,
(select   count(*)  from  dacs_station  dd
where  dd.is_open='4' ) as tj_pinggu ,
 
(
 select (sum(cn.high_line_count)+ sum(cn.low_line_count))*3   from dacs_site_alg_vararg_config_new cn left join dacs_station ds on cn.site_code = ds.station_code where ds.is_open>2 and ds.is_open<6
 as dacs_site_alg_tj
 from dual

  


----------最近1个月 1月份登录的的top10

SELECT cc.nick_name ,cc.user_name , max(ss.login_time) as login_lasttime, count(*) as login_count FROM `sys_logininfor` ss, sys_user cc
where ss.`status`=0
and ss.login_time >= '2024-01-01'
and ss.login_time<='2024-01-31'
and ss.user_name=cc.user_name
group by cc.nick_name,cc.user_name
ORDER BY login_count DESC
limit 10 ;

 

------------每天的登录数据---
select DATE_FORMAT(ss.login_time, '%Y-%m-%d') as monthtj ,count(*) as logincs from sys_logininfor ss
where ss.status=0 and ss.user_name not in ('admin','ceshi')
and ss.login_time >= '2023-01-01'
and ss.login_time<='2024-01-31'
group by monthtj
order by monthtj asc

------------每月的登录数据---
select DATE_FORMAT(ss.login_time, '%Y-%m') as monthtj ,count(*) as logincs from sys_logininfor ss
where ss.status=0 and ss.user_name not in ('admin','ceshi')
and ss.login_time >= '2023-01-01'
and ss.login_time<='2024-01-31'
group by monthtj
order by monthtj asc

基本功(可靠 安全 故障)---
----------每个月工程服务提报的故障问题分析趋势

数据安全技能,前端后端 网络 数据安全
开源调研报表工具
BI卡片
-------
登记的问题,分类
已解决问题后的问题分类。
提报问题的人。。。
-------
快速部署开发环境。。。
----

posted @   beawh  阅读(5)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
点击右上角即可分享
微信分享提示