Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««23456»»

T-SQL query Expand / Collapse
Author
Message
Posted Monday, May 05, 2008 2:12 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, April 11, 2014 1:53 PM
Points: 824, Visits: 1,207
Maybe that's why we keep getting these QoDs - the poster inherited a system using this awful code. ;)

That being said, this is the second of these strange "out of the box" type questions. It was pretty poor last time and equally poor this time. The solution given may be technically correct, but it doesn't show better ways of doing it and breaks once you switch from English to just about any other language.

I'd love to see just a little more screening for better QoDs rather than get another one of these. It's not just that it's not really challenging to figure "yes, there must be another way", but the answer is lacking. There are multiple solutions and I probably wouldn't mind if more of those were listed, but just to leave the language-specific solution in the answer alone makes it a pretty poor question/answer.



Post #495249
Posted Tuesday, May 06, 2008 2:09 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 23, 2009 12:42 PM
Points: 3, Visits: 8
the answer is not an multilingual answer ! i prefer to use the month number!
Post #495445
Posted Tuesday, May 06, 2008 3:01 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, November 11, 2013 2:42 AM
Points: 150, Visits: 245
Stupid question, pointless answer, 'nuff said.

Throw away your pocket calculators; visit www.calcResult.com

Post #495454
Posted Tuesday, May 06, 2008 5:56 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, February 18, 2014 7:14 AM
Points: 1,344, Visits: 1,983
Although I realised that this was another silly question which was going to have an answer which was language specific, inflexible and basically stupid, my immediate thought was to use Boolean algebra. :)

Since 'A OR B' can alwasy be rewritter as 'NOT (NOT A AND NOT B)' then the (still silly) solution of
where
mob = 1
or mob = 3
or mob = 4
or mob = 5
or mob = 7
or mob = 8

can be rewritten as
where not (
mob <> 1
and mob <> 3
and mob <> 4
and mob <> 5
and mob <> 7
and mob <> 8
)

Which satisfies the (poorly specified) requirement of using neither IN nor OR. :D


Derek
Post #495526
Posted Tuesday, May 06, 2008 9:11 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, October 04, 2012 9:20 AM
Points: 583, Visits: 1,060
mike brockington (5/6/2008)
Stupid question, pointless answer, 'nuff said.


I totally agree - English question - English Answer

Does it work in Swahili, Spanish, French and German? Can I spell Swahili?

:D 'If you database was not adequately designed - accept your applications will be crap!' :D

--Shaun Tzu's Art of DBAdmin and Design


Hiding under a desk from SSIS Implemenation Work
Post #495724
Posted Monday, May 12, 2008 1:32 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, March 13, 2014 9:09 PM
Points: 69, Visits: 440
Select (datepart(m,getdate())-1)*(datepart(m,getdate())-3)*(datepart(m,getdate())-5)*(datepart(m,getdate())-7)*(datepart(m,getdate())-8)
:)



Post #499079
Posted Tuesday, May 13, 2008 1:18 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, November 21, 2013 12:43 PM
Points: 10, Visits: 14
Totally agree.This type of questions make look the problem from different angle.
Post #499357
Posted Tuesday, May 13, 2008 1:28 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, March 15, 2012 9:23 AM
Points: 71, Visits: 68
"Like" no es un operador que pertenece a los "Search Arguments"
Post #499934
Posted Wednesday, May 28, 2008 3:28 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Friday, September 21, 2012 1:52 PM
Points: 696, Visits: 743
And, here I am, misinterpreting the question. I read it as using EITHER would satisfy the condition of not using BOTH!

There's always an orthogonal way to read something obvious. Personally, i think that using neither ... nor... would have been more unambiguous.
Post #508050
Posted Thursday, May 29, 2008 2:00 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, October 04, 2012 9:20 AM
Points: 583, Visits: 1,060
steve smith (5/28/2008)
And, here I am, misinterpreting the question. I read it as using EITHER would satisfy the condition of not using BOTH!

There's always an orthogonal way to read something obvious. Personally, i think that using neither ... nor... would have been more unambiguous.


You hit the nail on the head mate. We are all after all a rather pedantic and suposedly precise set of people - therfore abiguity needs to be eradicated with extreme predjudice, else we will interpret.
(and the client will get precisely what they asked for not what they want).


Hiding under a desk from SSIS Implemenation Work
Post #508235
« Prev Topic | Next Topic »

Add to briefcase «««23456»»

Permissions Expand / Collapse