Topic: [转帖]SQL 很难面试题,求助! |
Print this page |
1.[转帖]SQL 很难面试题,求助! | Copy to clipboard |
Posted by: ranchgirl Posted on: 2005-12-30 13:08 This is copied from ChinaJavaWorld.com. I want to know the answer too. It seems real hard. I put the several posts of original question together here. If somebody is able to find the answer of it. Here we are: ============= A real interview question from a famous company which I got today. I still don't know the answer, please help. It is easy to use Java to do it, but how to use SQL to get the result???
How to use SQL to get the statistics of count(USER_ID) each date covered in the table??? The "Actual Users (not needed)" is for you to understand. The third column is not part of the result. They are just my understanding about what USER_IDs are counted. on is starting time, off is end time. That is why it is hard, since you must count the date in-between too. For example
means USER_ID 3 turned on the service on at 2003-12-31, turned off the service on 2004-01-05, used the service for 6 days. Partial days are counted as full day.
Thanks a lot! ============= |
2.Re:[转帖]SQL 很难面试题,求助! [Re: gongshi] | Copy to clipboard |
Posted by: ranchgirl Posted on: 2005-12-30 13:10 Here is the link if someone wants to see the original discussion: http://bbs.chinajavaworld.com/post/view?bid=8&id=701494&sty=1&tpg=1&age=0 It is hard |
3.Re:[转帖]SQL 很难面试题,求助! [Re: ranchgirl] | Copy to clipboard |
Posted by: niugy Posted on: 2006-02-13 10:09 没明白楼主表达的意识,能否用中文再重新描述一下? |
4.Re:[转帖]SQL 很难面试题,求助! [Re: ranchgirl] | Copy to clipboard |
Posted by: whilezf Posted on: 2006-02-13 12:36 这不是一个很困难的问题,用SQL实现比用JAVA实现要容易 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |