当前位置:   article > 正文

1747 应该被禁止的Leetflex账户_1747. 应该被禁止的 leetflex

1747. 应该被禁止的 leetflex

题目描述:
在这里插入图片描述
编写一个SQL查询语句,查找那些应该被禁止的Leetflex帐户编号account_id。 如果某个帐户在某一时刻从两个不同的网络地址登录了,则这个帐户应该被禁止。
可以以任何顺序返回结果。
查询结果格式如下例所示:
在这里插入图片描述
Account ID 1 --> 该账户从 “2021-02-01 09:00:00” 到 “2021-02-01 09:30:00” 在两个不同的网络地址(1 and 2)上激活了。它应该被禁止.
Account ID 2 --> 该账户在两个不同的网络地址 (6, 7) 激活了,但在不同的时间上.
Account ID 3 --> 该账户在两个不同的网络地址 (9, 13) 激活了,虽然是同一天,但时间上没有交集.
Account ID 4 --> 该账户从 “2021-02-01 17:00:00” 到 “2021-02-01 17:00:00” 在两个不同的网络地址 (10 and 11)上激活了。它应该被禁止.

方法1:
主要思路:解题链接汇总

select  distinct l2.account_id as account_id
from LogInfo as l1 ,LogInfo as l2 
where l1.account_id=l2.account_id and l1.ip_address<>l2.ip_address and l1.login>=l2.login and l1.login<=l2.logout
  • 1
  • 2
  • 3
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号