|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 3:00 AM
Points: 1,151,
Visits: 879
|
|
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 Verster Developer Johannesburg South Africa
Life is about choices.... I choose to be happy today
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Tuesday, February 26, 2013 3:55 AM
Points: 2,039,
Visits: 29
|
|
I made the right choice that is #2 but it says that I'm wrong?? Please correct it please.
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 7:05 AM
Points: 4,804,
Visits: 8,069
|
|
|
|
|
|
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?
|
|
|
|
|
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!!
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, April 04, 2013 4:54 AM
Points: 1,383,
Visits: 520
|
|
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 DateOfLeaving dcd 2000-08-10 00:00:00.000 abc 1999-10-10 00:00:00.000 bcd 1998-11-11 00:00:00.000 ccd NULL eed NULL
and the question stated that the solution should be:
EmpName DateOfLeaving Bcd 11 Nov 1998 Abc 10 Oct 1999 Dcd 10 Aug 2000 Ccd null Eed null
Therefore I guess thtat the question is worng. At least I should get a point for writing this reply! :P
Regards,
Phil
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:04 AM
Points: 1,342,
Visits: 1,946
|
|
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
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 8:33 AM
Points: 2,722,
Visits: 987
|
|
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 last Doesn'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
|
|
|
|
|
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 leaving Maybe 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 leaving
Anyway 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 ;)
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Yesterday @ 1:35 AM
Points: 4,789,
Visits: 1,336
|
|
Another controversial question, where you tend to lose points though u know the answer....
|
|
|
|