Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 BETWEEN Rate Topic Display Mode Topic Options
Author
 Message
 Posted Wednesday, June 11, 2008 5:26 PM
 SSC-Insane Group: General Forum Members Last Login: Yesterday @ 5:08 PM Points: 22,083, Visits: 28,985
 VALEK (6/11/2008)Lynn Pettis (6/11/2008)To paraphrase what someone else once said on this site, "The proof is in the code." Here is the code:`...while @LoopCnt < 100...`Based on the results, the answer is still NO.Replace the code above wi th the following and comeback to me us the result (if you are still alive)`...while @LoopCnt < 1000000000000000000000000000000000000000000000...`Don't forget to write another script to analyse the result, since the output will be quite long.It is in your court now. Sorry, but even if the two queries come back once with the same results, the answer is still NO. The reason is consistently return the same results. If BETWEEN 3 AND 5 was the same as BETWEEN 5 AND 3, the results of each run would have been consistant between the two queries.
Post #515592
 Posted Wednesday, June 11, 2008 6:45 PM
 Old Hand Group: General Forum Members Last Login: Tuesday, October 22, 2013 5:49 PM Points: 374, Visits: 427
 It is in your court now. Sorry, but even if the two queries come back once with the same results, the answer is still NO. The reason is consistently return the same results. If BETWEEN 3 AND 5 was the same as BETWEEN 5 AND 3, the results of each run would have been consistant between the two queries.Don't forget the third option: NOT KNOWN. We all know that the question was about BETWEEN, so why the hell did they use RAND() and some dodgy table?I would phrase the question like this: do BETWEEN a AND b and BETWEEN b AND a in the WHERE clause have the same effect? YES/NO/UNKNOWN.Let's put a fullstop on this. Everyone knows now the mechanics of BETWEEN and difference between BETWEEN a AND b and BETWEEN b AND a. The problem is that for me as a mathematician and a programmer, the original question contained redundant and confusing irrelevant information. Nevertheless I answered the question correctly since I guessed the purpose and ignored the dodgyness of the testbed. Though I decided to raise the conversation for the conversation sake so that everyone knows that not all questions comes clear to everyone as it does to the person asking the question. Thats all.over M.Sc.IT, M.B.A, MCTS BI 2008, MCITP BI 2008, MCTS SQL Dev, CSM, CDVDM
Post #515603
 Posted Wednesday, June 11, 2008 8:58 PM
 SSC-Dedicated Group: General Forum Members Last Login: Today @ 4:43 AM Points: 34,537, Visits: 28,702
 ... and that's why I hate multiple-guess questions... gimme a good solid essay question or lemme write some code, instead!That was a fun conversation to watch... thanks, Gents. :) --Jeff Moden"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column." "Change is inevitable. Change for the better is not." -- 04 August 2013(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013Helpful Links:How to post code problemsHow to post performance problems
Post #515624
 Posted Thursday, June 12, 2008 1:25 AM
 Ten Centuries Group: General Forum Members Last Login: 2 days ago @ 8:37 AM Points: 1,044, Visits: 2,987
 VALEK (6/11/2008)Let's put a fullstop on this.Several people tried to do that a couple of pages ago, but you still wanted the last word. It was on page 4 of this thread that Lynn first said "I think we're going to have to agree to disagree".Everyone knows now the mechanics of BETWEEN and difference between BETWEEN a AND b and BETWEEN b AND a. The problem is that for me as a mathematician and a programmer, the original question contained redundant and confusing irrelevant information. Nevertheless I answered the question correctly since I guessed the purpose and ignored the dodgyness of the testbed. Though I decided to raise the conversation for the conversation sake so that everyone knows that not all questions comes clear to everyone as it does to the person asking the question. Thats all.overIs this still part of the "fullstop", or shall we call it a postscript? An appendix, perhaps? Semper in excretia, sumus solum profundum variat
Post #515699
 Posted Friday, June 13, 2008 2:13 PM
 SSCertifiable Group: General Forum Members Last Login: Yesterday @ 11:11 AM Points: 7,020, Visits: 14,240
 Wow!~ my own mini religious war! I have to say I'm impressed with how riled up we've managed to get....Anyway - like Steve has mentioned before - it might not be so easy as you think, so perhaps help bring up the quality of the questions by posting some of your own. Trying to ask something with a reasonable setup without necessarily shouting out the correct answer takes a bit of tuning, and I seem to have been a bit off-key on this one.I do think there's no doubt it could have been worded more clearly, so I can take these comments to mind for any other questions I might put out there.Anyway thanks! and I look forward to your collective contributions! ----------------------------------------------------------------------------------Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Post #517051
 Posted Friday, June 13, 2008 2:32 PM
 SSC-Insane Group: General Forum Members Last Login: Yesterday @ 5:08 PM Points: 22,083, Visits: 28,985
 Matt, I think to characterize this as a religious war is a little dramatic. I'd simply call it a strong difference of opinion.As I said earlier, I'll agree to disagree. It was a good question, and I would not classify it as a trick question. It tested you ones knowledge of the BETWEEN clause as implemented in T-SQL.
Post #517060
 Posted Friday, June 13, 2008 5:30 PM
 SSCertifiable Group: General Forum Members Last Login: Yesterday @ 11:11 AM Points: 7,020, Visits: 14,240
 Oh fair enough Lynn. I just haven't been getting notified about posts, so coming back to find having ballooned out to 60 or so posts was astounding. But you're right - we're not talking NULLs handling or Identity fields, this is much milder....Still amazing how "lively" the debate gets to be:) ----------------------------------------------------------------------------------Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Post #517109
 Posted Thursday, July 10, 2008 7:07 AM
 SSC-Enthusiastic Group: General Forum Members Last Login: Monday, October 22, 2012 8:55 AM Points: 124, Visits: 180
 Hmm.. Definitely open to interpretation. "Would statements #1 and #2 consistently return the same result set?"Yes, they would... Every time I run it, they consistently give me the same result set. The second one would just contain a zero. Needs re-writing or removal, methinks.
Post #531559
 Posted Monday, August 04, 2008 11:22 PM
 Valued Member Group: General Forum Members Last Login: Thursday, September 23, 2010 12:44 AM Points: 63, Visits: 46
 I'm with you on this one! The wording on the question was ambiguous and I interpreted it in a way that the writer did not intend... Kristen Hodgesb. http://bi-tch.blogspot.com
Post #546515
 Posted Tuesday, August 05, 2008 12:00 AM
 SSC-Dedicated Group: General Forum Members Last Login: Today @ 4:43 AM Points: 34,537, Visits: 28,702
 Lynn Pettis (6/13/2008)I'd simply call it a strong difference of opinion.Heh... isn't that the way religious wars get started. :P --Jeff Moden"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column." "Change is inevitable. Change for the better is not." -- 04 August 2013(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013Helpful Links:How to post code problemsHow to post performance problems
Post #546524

 Permissions