Query

  • The second option would fail if the month name is only 'Feb' there is no 'a' in it.... so my answer is correct!

  • abhijeetv (4/15/2008)


    The second option would fail if the month name is only 'Feb' there is no 'a' in it.... so my answer is correct!

    Since the statement used returns the entire word, and not the abbreviation (language spelling excluded) your answer is WRONG!

    Why we have to continue to belabor this point, I have no idea. The person who wrote the question tried. Everyone here was enlighted to all the issues that can arise, and it stirred a great deal of very very good discussion.

    However, comments like "I was right, and you were wrong, is just childish." Grow up!

  • No arguments there about the full word. just that why go checking for alphabets when it can be done simply. what if the months i needed did not have a common alphabet. but yea i wont moan any more... im all grown up sigh!!! koi lauta de mera bachhpan....

  • :w00t: Even if the dob issue is disregarded, and if we disregard the fact that 'Feb' doesn't contain the letter 'a', it's really atrocious to use a where clause like the one in the second "correct" answer. Why would anybody ever do that?

  • Using IN (1 ... 12) is safer. Using LIKE %a% is unsafe because in human languages other than English the spelling of month names may not provide the expected result.

    Regards, Jon Summers

  • Hugo Kornelis (4/7/2008)


    Hi all,

    In contrast to some other people in this discussion (and in many other QotD related discussions), I really don't care about points. Points are just a fun way to attract more audience to what should be a mix of fun and education. And the latter (the educational part) is what worries me when I see incorrect answers being marked as correct - and worries me even more when I see absolute bad practices being advertised as a correct answer, without even a disclaimer that this should never be done in a real system.

    I'm inclined to agree with all of that comment, inclusing the bit not quoted.

    I'd also thow in the comment that since there are a finited number of months in a year a predicate of the form month(join_date) in <list> must have a matching predicate of the form month(join_date) not in <list> so that if one could be right so could the other. So as well as the trivial mistype and the not-so-trivial assumptions about collation and locale it's probably also wrong to reject the third option, since people will surely interpret "list" as a placeholder in teh code for the appropriate list.

    Tom

Viewing 6 posts - 91 through 95 (of 95 total)

You must be logged in to reply to this topic. Login to reply