每日一刷:java基础+sql
Posted !0 !
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了每日一刷:java基础+sql相关的知识,希望对你有一定的参考价值。
java基础
题解:JAVA中是用final
题解:没有用break,所以会一直执行
题解:A、循环语句才会一直执行
题解:threadlocalmap使用开放定址法解决haah冲突,hashmap使用链地址法解决hash冲突
sql语句
select u.name,c.name,l.date
from login l
join user u
on l.user_id = u.id
join client c
on l.client_id = c.id
where (l.user_id,l.date) in (
select user_id, max(date)
from login
group by login.user_id
)
order by u.name;
select
round(count(distinct user_id)*1.0/(select count(distinct user_id) from login) ,3)
from login
where (user_id,date)
in (select user_id,DATE_ADD(min(date),INTERVAL 1 DAY) from login group by user_id);
select login.date,ifnull(n1.new_num,0)
from login
left join (
select l1.date,count(distinct l1.user_id) new_num
from login l1
where l1.date = (
select min(date)
from login
where user_id=l1.user_id
)
group by l1.date
) n1
on login.date = n1.date
group by login.date
order by login.date
以上是关于每日一刷:java基础+sql的主要内容,如果未能解决你的问题,请参考以下文章