﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Raghavan CV  / Query / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 21:36:10 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]Hugo Kornelis (4/7/2008)[/b][hr]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.[/quote]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 &amp;lt;list&amp;gt; must have a matching predicate of the form  month(join_date) not in &amp;lt;list&amp;gt; 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.</description><pubDate>Thu, 22 Apr 2010 19:36:28 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>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.</description><pubDate>Sun, 24 Jan 2010 11:18:56 GMT</pubDate><dc:creator>Jon Summers</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>: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?</description><pubDate>Fri, 18 Apr 2008 09:51:44 GMT</pubDate><dc:creator>Carmen Vacar</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>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....</description><pubDate>Tue, 15 Apr 2008 11:43:29 GMT</pubDate><dc:creator>aarif.pd</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]abhijeetv (4/15/2008)[/b][hr]The second option would fail if the month name is only 'Feb' there is no 'a' in it.... so my answer is correct![/quote]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!</description><pubDate>Tue, 15 Apr 2008 07:19:34 GMT</pubDate><dc:creator>Bob Fazio</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>The second option would fail if the month name is only 'Feb' there is no 'a' in it.... so my answer is correct!</description><pubDate>Tue, 15 Apr 2008 06:34:38 GMT</pubDate><dc:creator>abhijeetv</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>The first option is the only correct one when you take into account languages etc. The second option only true for some languages.</description><pubDate>Thu, 10 Apr 2008 04:23:51 GMT</pubDate><dc:creator>aarif.pd</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>... And what about the Not in List option?  I didn't see DATEPART(month,join_date) in (1,2,3,4,5,8) in the list, so that should be a valid option too</description><pubDate>Wed, 09 Apr 2008 18:24:03 GMT</pubDate><dc:creator>Noffer</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>I like the math here ;-)Correct answers: 72% (966) [font="Courier New"]--------------------------------------------------------------------------------month(join_date) in (1,2,3,4,5,8)   61% datename(m,join_date) like '%a%'    37% Not in List                         26% --------------------------------------------------------------------------------[/font]Or was Steve just hacking into the table directly :DI also had it wrong, but how do ya say? *$%# happens.Let he who is without bugs, cast the first stone... (it'snot me of course)</description><pubDate>Tue, 08 Apr 2008 12:03:59 GMT</pubDate><dc:creator>Christian Buettner-167247</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>So it was not really a bad question....Just a poorly written set of answers. :Whistling:--Shaun</description><pubDate>Tue, 08 Apr 2008 09:54:12 GMT</pubDate><dc:creator>Shaun McGuile</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]Shaun McGuile (4/8/2008)[/b][hr]Is the question poster a US citizen by any chance? :Dit would explain the 'english' bias of the question.[/quote]I'm a US Citizen... doesn't change the fact that I'm cognizant of the fact that there are other languages out there.</description><pubDate>Tue, 08 Apr 2008 09:49:05 GMT</pubDate><dc:creator>mtassin</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>Is the question poster a US citizen by any chance? :Dit would explain the 'english' bias of the question.</description><pubDate>Tue, 08 Apr 2008 09:44:34 GMT</pubDate><dc:creator>Shaun McGuile</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>I hate to beat this dead horse, but the corrected question/answer went out today.[quote]Explanation: Either of the first two answers will work. All the month names have at least the letter 'a' once. The month function returns the number of the month, that can be compared against the month number of given months[/quote]In Spanish, the month of february is febrero, in french it's Février, etc... and depending on the language settings your SQL server is set to, you'll get different results.   Because of that, datename(m,join_date) like '%a%' is not 100% valid.</description><pubDate>Tue, 08 Apr 2008 09:20:53 GMT</pubDate><dc:creator>mtassin</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>Regardless of the presence of dob in the author s answer, I feel that the answer provided by the author is not right. The first option "Month(join_date) In (1,2,3,4,5,8)" would be the rigth answer with respect to the question he has asked.A word to the Author of the question:I suggest you have another look at your question !!:doze:</description><pubDate>Mon, 07 Apr 2008 21:35:20 GMT</pubDate><dc:creator>Linson.Daniel</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>I think we should stop this.Personally I have not put the message claiming nothing, but to joke with the situation.         (See my message emoticons, which are for that)Nobody will die for a point less so, in my humble opinion, it should not make a scandal of it.I never would have imagined it was going to create this problem. Had I known beforehand, I do not write anything.I believe that neither Steve Jones nor the rest of the moderators, deserve to be accused in this way.Stop, guys, please.</description><pubDate>Mon, 07 Apr 2008 19:07:00 GMT</pubDate><dc:creator>Pablo Rafael</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>I can understand looking at the QotD as a puzzle sometimes and not always from a 'best practices' perspective. Good point Steve.</description><pubDate>Mon, 07 Apr 2008 10:58:44 GMT</pubDate><dc:creator>Jeff Deluca</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]Shaun McGuile (4/7/2008)[/b][hr][quote][b]aweican (4/7/2008)[/b][hr]datename(m,join_date) like '%a%' ???Where is the "a" in Feb[/quote]Oh dear! how to miss the point! :D[/quote]:(, My fault about "Febuary". If it was an interview question, I will faild for sure.</description><pubDate>Mon, 07 Apr 2008 10:37:58 GMT</pubDate><dc:creator>aweican</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]aweican (4/7/2008)[/b][hr]datename(m,join_date) like '%a%' ???Where is the "a" in Feb[/quote]Oh dear! how to miss the point! :D(Hint: it is s the 6th letter of febru[b]a[/b]ry)</description><pubDate>Mon, 07 Apr 2008 10:05:00 GMT</pubDate><dc:creator>Shaun McGuile</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>datename(m,join_date) like '%a%' ???Where is the "a" in Feb</description><pubDate>Mon, 07 Apr 2008 10:01:28 GMT</pubDate><dc:creator>aweican</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]Steve Jones - Editor (4/7/2008)[/b][hr]If you see an issue, and someone else has posted it, answering a "me too, or dob isn't listed" just puts me in a bad mood.[/quote]Sorry Steve, sometimes we are lazy too :ermm: by not reading all the posts.  Plus at least that gets us our point.  :satisfied:  However, point taken, or not... I think I understand.</description><pubDate>Mon, 07 Apr 2008 09:43:15 GMT</pubDate><dc:creator>Bob Fazio</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]Jack Corbett (4/7/2008)[/b][hr][quote][b]bitbucket (4/7/2008)[/b][hr][b]Getting tired, so very tired of sloppily worded questions ...[/b] dob not defined as a column name in the table or for that matter anywhere in question ... so it can not, and will not return the correct values  :w00t:If a DBA was as careless as some of these last few questions, he/she would be looking for a job PDQ.  (Pretty darn quick).Proposed it twice before and will propose it again.  [b]Steve[/b] ask for volunteers to be appointed to a panel that checks and double checks these question [b]BEFORE[/b] they are published as the QOD.[/quote]Have you posted it in the Suggestions Forum, [url]http://www.sqlservercentral.com/Forums/Forum4-1.aspx[/url]?  I am not sure you can be guaranteed that Steve or anyone else is going to read every post in a forum containing a long list of the same complaint(s) over and over.  I think it is a good suggestion, but you need to be sure the people checking the questions know that portion of SQL Server.  It would be very difficult for me to adequately edit a question on Analysis Services or Full-Text Search as I do not currently use either so I don't have the knowledge to be sure I will know the correct answer(s).[/quote]I hate to quote myself, but I did make a post about ethe QOD in the Suggestions Forum to which Steve responded within about an hour.  Here is a link to Steve's response [url]http://www.sqlservercentral.com/Forums/Topic480829-4-1.aspx#bm480925[/url].Edit:  I was posting this as Steve posted his answer.  I still recommend looking at the link, it is an eye-opener.</description><pubDate>Mon, 07 Apr 2008 09:37:27 GMT</pubDate><dc:creator>  Jack Corbett</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>Tom,Before I respond, Scotty, I need more power to the forward shields (bad, Donald-Farmer-like-Scottish-Accent in place here).My apologies for the column thing. I didn't notice it. I saw "dob" and thought "date", not realizing that join_date was the column, even though I read it.Everyone has points back and the answer has been corrected.As much as I'd like to agree with Hugo, I'm sure neither I nor he would fire someone for this. They might get a nice, long, tongue lashing, but if I fired everyone that wrote a stupid SQL statement, I'd be the only one writing them.OK, if you want to complain, try to set up your own question. It's easy, in fact, dirt simple, to make a mistake in an answer. Now do that 2000 times as I have done. I've probably gotten more write than wrong, but the wrongs are probably numbering in the 100s. We don't try to drive up stats. If you see an issue, and someone else has posted it, answering a "me too, or dob isn't listed" just puts me in a bad mood. At least be creative like Tom (http://www.sqlservercentral.com/Forums/Search1-1-2.aspx?SessionID=1hmhej45kupwi545b0bseki1&amp;SortBy=2&amp;SortOrder=1)It's worse when you pick on someone that tried a question. Have some understanding and I'll get to this. you're welcome to flood my PM box with complaints if I take longer than a day to fix your points. That's on me.We tried to have people look at questions beforehand. We even had someone as dedicated as Hugo to helping people, join in. They lasted a few months before proofing questions became a job and not fun. Not saying that we won't try again (need some developer time to get this working), but not sure it will work. I think having someone like Hugo (not to pick on Hugo), post a note here when there's an issue will help.I shall drop a note in tomorrow's newsletter about this in more detail. Feel free to comment there and suggest things, complain, etc. If you complain, and complaints are welcome, please submit a question or two yourself so you understand.Lastly, the QOD is not necessarily here to show best practices. I saw today's question as a puzzle more than a best way to do this. My frame of reference was different there. That's the other issue; depending on what I'm thinking, I see the questions in a different light.Plus I hate to tell someone that their QOD stinks. I realize that I'm not the best judge of things sometimes.</description><pubDate>Mon, 07 Apr 2008 09:35:05 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>People, give it a rest. Why do 20 or so people repeat what's been said in first few posts?What if site owners decide not to post qod at all? Heck, the site it free, exchange of information is free and all moderators get is whining.It's a torture to read over 70 posts most repeating the same thing "Mistake, bad question, give me my points". So, stop it, please.</description><pubDate>Mon, 07 Apr 2008 09:34:31 GMT</pubDate><dc:creator>Robert-378556</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>I chose option two as option one looked more like Date Of Birth which would be incorrect... :P</description><pubDate>Mon, 07 Apr 2008 09:23:04 GMT</pubDate><dc:creator>neha.jkrishnan</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>A question intended to testwas misworded, so wasn't the best.Calls of "I've been mistreated"were incessantly repeated,so come on, guys; please give it a rest.</description><pubDate>Mon, 07 Apr 2008 09:18:19 GMT</pubDate><dc:creator>majorbloodnock</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>Harrumph!  I agree with the previous posts.  A poorly designed question with no good answer.I know it is only one point, but come on.-km</description><pubDate>Mon, 07 Apr 2008 09:13:28 GMT</pubDate><dc:creator>Kevin Martin</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>Sorry, you are wrong. The first is not correct as the condition is on the wrong column - dob rather than join_date. The second is correct as each month's full name contains an 'a'.The first WOULD HAVE been a better choice though - had the column been correct.Nancy</description><pubDate>Mon, 07 Apr 2008 09:01:31 GMT</pubDate><dc:creator>nancy-591121</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]Jignesh Mehta (4/6/2008)[/b][hr]The other answer " datename(m,join_date) like '%a%' " is also not correct as it will not give the list of employees who joined in the month of [b]FEB[/b][/quote]Well technically the letter a is in the month of February.Not sure exactly what dob has to do with the hire date or join_date though.In either case, using like in this manner for join criteriadatename(m,join_date) like '%a%'is a very poor choice, if SQL server is in another language the letter a may not be in the spellings of the month names.   If month(dob) was month(hire_date) or month(join_date), it would be the correct choice.</description><pubDate>Mon, 07 Apr 2008 09:00:18 GMT</pubDate><dc:creator>mtassin</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>Steady on Tom - what's the point in Tar and Feathering an empty corpse? :)</description><pubDate>Mon, 07 Apr 2008 08:50:13 GMT</pubDate><dc:creator>Shaun McGuile</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>Steve,So you have anything to add before you're DRAWN AND QUARTERED, HUNG FROM THE YARDARM, TARRED AND FEATHERED, and BURNED AT THE STAKE?:hehe:</description><pubDate>Mon, 07 Apr 2008 08:42:12 GMT</pubDate><dc:creator>Tom Garth</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>It cannot possibly be 'dob' cause the question specifies join_date column.</description><pubDate>Mon, 07 Apr 2008 08:38:41 GMT</pubDate><dc:creator>Paul A</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>I want my point.Please do a better job of proofreading your questions.):-D</description><pubDate>Mon, 07 Apr 2008 08:36:58 GMT</pubDate><dc:creator>Dr. Diana Dee</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>I agree.  Qods have become so careless and subjective as to be worthless.As everyone else has noted, wth does "dob" have to do with "join" date?</description><pubDate>Mon, 07 Apr 2008 08:29:20 GMT</pubDate><dc:creator>ScottPletcher</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>As one who is analytical, precise, and leaves nothing up for assumption, the question was written in a manner that is neither analytical, precise, and leaves EVERYTHING up for assumption.  The question suggests that the author requires a micro-manager so that critical functions of an enterprise are not left up for assumption.</description><pubDate>Mon, 07 Apr 2008 08:23:23 GMT</pubDate><dc:creator>Mike DiRenzo</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>This question is wrong.  It specifies the column "join_date" but one of the "correct" answers uses the function "month(dob)".Ed</description><pubDate>Mon, 07 Apr 2008 08:22:43 GMT</pubDate><dc:creator>Ed Leighton-Dick</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]bitbucket (4/7/2008)[/b][hr][b]Getting tired, so very tired of sloppily worded questions ...[/b] dob not defined as a column name in the table or for that matter anywhere in question ... so it can not, and will not return the correct values  :w00t:If a DBA was as careless as some of these last few questions, he/she would be looking for a job PDQ.  (Pretty darn quick).Proposed it twice before and will propose it again.  [b]Steve[/b] ask for volunteers to be appointed to a panel that checks and double checks these question [b]BEFORE[/b] they are published as the QOD.[/quote]Have you posted it in the Suggestions Forum, [url]http://www.sqlservercentral.com/Forums/Forum4-1.aspx[/url]?  I am not sure you can be guaranteed that Steve or anyone else is going to read every post in a forum containing a long list of the same complaint(s) over and over.  I think it is a good suggestion, but you need to be sure the people checking the questions know that portion of SQL Server.  It would be very difficult for me to adequately edit a question on Analysis Services or Full-Text Search as I do not currently use either so I don't have the knowledge to be sure I will know the correct answer(s).</description><pubDate>Mon, 07 Apr 2008 08:13:18 GMT</pubDate><dc:creator>  Jack Corbett</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>Jignesh, datename(m, join_date) gives the complete month name, not abbreviated name.</description><pubDate>Mon, 07 Apr 2008 08:10:55 GMT</pubDate><dc:creator>abhay.kulkarni</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>yeah, assuming dob is date of birth, we are talking of joining date, not DOB, doob!The first option would have been okay if dob was replaced by join_date. :w00t:</description><pubDate>Mon, 07 Apr 2008 08:09:31 GMT</pubDate><dc:creator>abhay.kulkarni</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>Hi Bitbucket,[quote][b]bitbucket (4/7/2008)[/b][hr]Proposed it twice before and will propose it again.  [b]Steve[/b] ask for volunteers to be appointed to a panel that checks and double checks these question [b]BEFORE[/b] they are published as the QOD.[/quote]If Steve decides to adopt this idea, I'll gladly volunteer to be in the panel.</description><pubDate>Mon, 07 Apr 2008 08:09:06 GMT</pubDate><dc:creator>Hugo Kornelis</dc:creator></item><item><title>RE: Query</title><link>http://www.sqlservercentral.com/Forums/Topic480437-1245-1.aspx</link><description>[quote][b]webrunner (4/7/2008)[/b][hr][quote][b]Jack Corbett (4/7/2008)[/b][hr]I just have a couple of questions for all who have posted about this issue, did you respond to the QOD survey that was released recently?  Also have you ever submitted a QOD?  I agree that the first option is not a correct answer based on the question, but what are you and I doing to improve things?[/quote]Thanks - I did not notice a QOD survey - do you have a link for it you could provide?Thanks again!-webrunner[/quote]I tried to find the link to it and did not, even though I know I filled it out.  I have posted in the suggestions forum that they put a link to it on the QOD page.</description><pubDate>Mon, 07 Apr 2008 08:08:27 GMT</pubDate><dc:creator>  Jack Corbett</dc:creator></item></channel></rss>