June 23, 2008 at 4:23 pm
What I think was meant by that was in the select list: EmpName, DateOfLeaving. If you were to have more than 2 columns, you'd want the DateOfLeaving listed last. I base that off of looking at the requested output based on the sample data provided.
😎
June 23, 2008 at 4:47 pm
This is definitely wrong. Only 2nd one is correct
June 23, 2008 at 5:49 pm
Glad I'm not the only one that was confused by this question.
The question stated
"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, Name sorted in ascending order for each group"
ie. The DateOfLeaving is to be sorted ascending.
-- John Oliver
Sometimes banging your head against a wall is the only solution.
June 23, 2008 at 7:05 pm
antony (6/22/2008)
I also picked option 2, only to be told I was wrong, and should have picked option 2!:crying:
I had the same experiece as antony.
June 23, 2008 at 7:11 pm
Good to know in the end that there were other people who had problems. But I wasn't as annoyed at getting it wrong has I have more than my fair share of wrong answers, more annoyed about the fact that I thought I had one I could get right for a change.
nice that the author admitted his mistakes, and I am still learning SQL and these are a very good way to test my skill in using but more in remembering how to use the product. We all learn from our mistakes but you would hope next time for other problem questions that they go under some kind of review prior to being posted for people to answer, as I am sure that the moderators of the site have more than enough experience to be able to spot small problems like these.
Best of luck the the future ones.
June 23, 2008 at 7:30 pm
They have the experience, that isn't the issue. The issue is having the time to vet all the questions along with everything else they have to do to keep the site running.
😎
June 23, 2008 at 7:41 pm
June 23, 2008 at 8:23 pm
So, I'm going to get my point for this - like others have said #3 is WRONG
Select EmpName, DateOfLeaving from Employees order by DateOfLeaving desc, EmpName asc would give you:
EmpName DateOfLeaving
Dcd 10 Aug 2000
Abc 10 Oct 1999
Bcd 11 Nov 1998
Ccd null
Eed null
not
EmpName DateOfLeaving
Bcd 11 Nov 1998
Abc 10 Oct 1999
Dcd 10 Aug 2000
Ccd null
Eed null
as the question stated.
Steve - where are you to fix this one ????
June 23, 2008 at 10:08 pm
What can I say more? I am in 94% as well.:hehe:
June 23, 2008 at 11:02 pm
Dear bitbucket,
Just copy and paste the T-SQL code written in my post and just execute it. You 'll get right answer.
Alternativelty you can copy the second option and remove single quote and place the single quote again. I think it 'll work fine.
🙂
June 24, 2008 at 6:18 am
Well, I think we all now know that there are a couple of issues with the question and answer, that the author has willingly admitted this, and that SSC has an issue with the amount of time necessary for proof-reading what is, eventually, an informative bit of fun.
However, does no-one see the irony with the posting of "why wasn't this QOTD proof-read" several pages after the same issue was first raised? Obviously, this doesn't encompass everyone who's answered in this thread, but how can someone demand better proof-reading if they themselves don't bother reading the preceding pages of the thread to see if their point has already been made?
Personally, I expect that, when Steve comes online, the "wrong" answers will be amended to "right" answers. After all, he's been pretty good at resolving these issues before, so why should this be different?
Semper in excretia, suus solum profundum variat
June 24, 2008 at 6:27 am
majorbloodnock (6/24/2008)
Well, I think we all now know that there are a couple of issues with the question and answer, that the author has willingly admitted this, and that SSC has an issue with the amount of time necessary for proof-reading what is, eventually, an informative bit of fun.However, does no-one see the irony with the posting of "why wasn't this QOTD proof-read" several pages after the same issue was first raised? Obviously, this doesn't encompass everyone who's answered in this thread, but how can someone demand better proof-reading if they themselves don't bother reading the preceding pages of the thread to see if their point has already been made?
Personally, I expect that, when Steve comes online, the "wrong" answers will be amended to "right" answers. After all, he's been pretty good at resolving these issues before, so why should this be different?
I think people are simply repeating the point so that they are heard as well, and with more people saying the same thing, then something might be done about it. Also, they wanted to have their point from the post seeing as they didn't get the point from the QotD 😉
June 24, 2008 at 6:36 am
I don't doubt you're right, Skyline.
OK, 17 pages, here we come 😉
Semper in excretia, suus solum profundum variat
June 24, 2008 at 8:57 am
I only have 6 pages here... not to say that showing 100 post on a page would even lower their number 😀
( just kidding 😉 )
I'm faithful too that someone sooner or later will fix that horrible red cross and put the right green mark 🙂
Have a nice day!
PS: I re-read the answer that the author gave:
In SQL Server T-SQL, by default, a query takes null as first when the order is ascending (the default). So we just give some value of greater date in order by so that it will come at last.
That seems quite clear, he probably ticked solution #3 as correct by accident, as a matter of fact everything else leads in the right direction 🙂
Viewing 15 posts - 91 through 105 (of 138 total)
You must be logged in to reply to this topic. Login to reply