Log in  ::  Register  ::  Not logged in

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

 Sort Order - Include Null al last Rate Topic Display Mode Topic Options
Author
 Message
 Posted Monday, June 23, 2008 12:24 AM
 Ten Centuries Group: General Forum Members Last Login: Friday, March 28, 2014 5:06 AM Points: 1,204, Visits: 915
 As far as I know, if you use isnull then the field, when null will take the value presented in the isnull, that means that question 2 must be right. Heck, can 98% people have it wrong. Shucks......... Manie VersterDeveloperJohannesburgSouth AfricaI can do all things through Christ who strengthens me. - Holy BibleI am a man of fixed and unbending principles, the first of which is to be flexible at all times. - Everett Mckinley Dirkson (Well, I am trying. - Manie Verster)
Post #521545
 Posted Monday, June 23, 2008 12:51 AM
 SSCrazy Group: General Forum Members Last Login: Monday, November 25, 2013 12:09 AM Points: 2,388, Visits: 32
 I made the right choice that is #2 but it says that I'm wrong??Please correct it please.
Post #521548
 Posted Monday, June 23, 2008 1:43 AM
 SSCarpal Tunnel Group: General Forum Members Last Login: Today @ 8:32 AM Points: 4,913, Visits: 8,625
 Really funny! I've been a member since 2002 and I've never answered qod before: I answered two questions in the last ten days and both were wrong!There's something wrong with me, maybe... --Gianluca SartoriGet your two-cent-answer quicklyspaghettidba.com@spaghettidba
Post #521568
 Posted Monday, June 23, 2008 1:58 AM
 SSC Rookie Group: General Forum Members Last Login: Wednesday, June 08, 2011 12:54 PM Points: 29, Visits: 32
 I also chose option 2 and was told that it's not correct. It seems that the "answer" is both options 2 and 3, which is incorrect. option 3 does not result in the sample output given the sample input. According to the explanation of the answer only option 2 is correct.This is my first time answering a question of the day, but clearly there seems to be something wrong here. What's going on with this question?
Post #521574
 Posted Monday, June 23, 2008 2:26 AM
 SSC Veteran Group: General Forum Members Last Login: Wednesday, July 13, 2011 2:21 AM Points: 251, Visits: 208
 :D Seems the author fell into the trap the question was trying to highlight. Only option 2 gives the required result!!
Post #521580
 Posted Monday, June 23, 2008 2:56 AM
 Ten Centuries Group: General Forum Members Last Login: Thursday, March 20, 2014 4:03 AM Points: 1,396, Visits: 549
 I selected option 2 (and only option 2) and was told I was wrong, as I needed to select option 2 & 3. However option 3 returns the results in the following order:EmpName DateOfLeavingdcd 2000-08-10 00:00:00.000abc 1999-10-10 00:00:00.000bcd 1998-11-11 00:00:00.000ccd NULLeed NULLand the question stated that the solution should be:EmpName DateOfLeavingBcd 11 Nov 1998Abc 10 Oct 1999Dcd 10 Aug 2000Ccd nullEed nullTherefore I guess thtat the question is worng. At least I should get a point for writing this reply! :P Regards,Phil
Post #521589
 Posted Monday, June 23, 2008 3:02 AM
 Ten Centuries Group: General Forum Members Last Login: Tuesday, February 18, 2014 7:14 AM Points: 1,344, Visits: 1,983
 Glad to see I'm not alone in deciding immediately that answer #3 with DateOfLeaving DESC wouldn't put the dates in the right order so is definitely wrong, irrespective of where the NULLs come! Derek
Post #521593
 Posted Monday, June 23, 2008 3:12 AM
 Hall of Fame Group: General Forum Members Last Login: Today @ 8:03 AM Points: 3,086, Visits: 1,145
 Only option 2 gives result as shown in the question, but reading back the question, I get really confused if that even was what was asked.The question is to have list off all employees with the employees with DateOfLeaving coming lastDoesn't this mean that employees without DateOfLeaving (the null values), should be first in the result set?!Guess the only good solution is to give everybody their points :D
Post #521598
 Posted Monday, June 23, 2008 3:24 AM
 SSC-Enthusiastic Group: General Forum Members Last Login: Thursday, January 08, 2009 1:32 AM Points: 129, Visits: 35
 The question is to have list off all employees with the employees with DateOfLeaving coming last and all others sorted ascending order of date of leavingMaybe he wanted to say this?The question is to have list off all employees with the employees without DateOfLeaving coming last and all others sorted ascending order of date of leavingAnyway the two answers which they say being correct have different results, so at least one of them is wrong... #3 in my opinion is wrong and I was very surprised of it when I was told that #2 alone was not correct ;)
Post #521603
 Posted Monday, June 23, 2008 3:46 AM
 SSCertifiable Group: General Forum Members Last Login: Thursday, March 20, 2014 7:32 AM Points: 5,191, Visits: 1,368
 Another controversial question, where you tend to lose points though u know the answer....
Post #521611

 Permissions