在这里,我试图在Comment 列中获取字符串的中间值( log in ),然后获取每个用户的计数。但我认为这不是正确的做法。你们还有什么办法吗……!
user# user ID Comments
101 user 1 ***log in*** : shera
101 user 1 ***log in*** : Mark
102 user 2 ***log out***
105 user 5 ***log in*** : Mark
104 user 4 ***ideal***
103 user 3 ***ideal***
101 user 1 ***ideal***
102 user 2 ***log out*** : since 5 mnt
105 user 5 ***log in*** : Mark
104 user 4 ***ideal***
103 user 3 ***log out***
查询需要设计用于:
log in ideal log out
user 1 2 0 3
user 2 0 2 5
user 5 0 2 1
------------------
Total 2 4 9
谢谢考虑。周杰伦