Is this possible with mysql?

前端 未结 6 1946
走了就别回头了
走了就别回头了 2021-01-16 12:42

First of all: sorry for the title, but maybe I will find a better one later.

I asked this some minutes ago, but since I was not able to describe what I want I try it

6条回答
  •  情书的邮戳
    2021-01-16 13:20

         SELECT today.user
              , GROUP_CONCAT(DISTINCT today.ip) ip
           FROM gc_sessions today
           JOIN gc_sessions yesterday
             ON DATE(yesterday.starttime) = DATE(today.starttime) - INTERVAL 1 DAY
            AND today.user = yesterday.user
          WHERE DATE(today.starttime) = '2013-01-10'
          GROUP 
             BY today.user;
    

提交回复
热议问题