SQLServerCentral » Article Discussions » Article Discussions by Author » Discuss content posted by Mark Tillman » The Percent Sign in T-SQLInstantForum 2016-2 FinalSQLServerCentralhttps://www.sqlservercentral.com/Forums/SQLServerCentralFri, 21 Jul 2017 03:46:22 GMT20The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070114.aspxComments posted to this topic are about the item [B]<A HREF="/questions/T-SQL/72388/">The Percent Sign in T-SQL</A>[/B]Fri, 02 Mar 2012 15:11:09 GMTmtillman-921105RE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1261062.aspxGood question and thank you.Fri, 02 Mar 2012 15:11:09 GMTzymosRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1071779.aspx[quote][b]SanDroid (3/1/2011)[/b][hr]
Tell me what the "≡" is and we will use wet noodles for the beating. :w00t:
[/quote]
"Is equivalent to", or "is exactly the same thing as"
(Stronger than '=')Wed, 02 Mar 2011 02:08:41 GMTToreadorRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1071751.aspx[quote][b]SanDroid (3/1/2011)[/b][hr][quote][b]Toreador (3/1/2011)[/b][hr][quote]
or more accurately
8 ≡ 2 (mod 6)
[/quote]
Tell me what the "≡" is and we will use wet noodles for the beating. :w00t:
[/quote]
It can mean a lot of things, but usually it is a strong indicator of equality or identity.
[url]http://en.wikipedia.org/wiki/Triple_bar[/url]
[url]http://en.wikipedia.org/wiki/List_of_logic_symbols[/url]
[url]http://en.wikipedia.org/wiki/Congruence_relation[/url]
[url]http://en.wikipedia.org/wiki/Equals_sign[/url]
Wed, 02 Mar 2011 00:17:34 GMTKoen VerbeeckRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1071605.aspx[quote][b]Toreador (3/1/2011)[/b][hr][quote]
or more accurately
8 ≡ 2 (mod 6)
[/quote]
Tell me what the "≡" is and we will use wet noodles for the beating. :w00t:
Tue, 01 Mar 2011 14:33:29 GMTSanDroidRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1071602.aspx[quote][b]mtillman-921105 (3/1/2011)[/b][hr]OK, The next time I submit a question, I'll be sure that the fluke answer, if there is one included, can in no way me misconstrued as a possible right answer.
I think some of you are used to trick questions, so you're looking for a sneaky answer.[/quote]
LOL... Perhaps we should also put in hints like....
"This is not the right answer"
"Don't click this for points"
"j/k"
"Check this answer to win!"
I saw nothing wrong with your question and understand a math joke when I read one. I liked your question, please do not change it at all.
It tested much more than peoples knowledge of SQL and questions that can do that are priceless.Tue, 01 Mar 2011 14:30:05 GMTSanDroidRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1071595.aspxOK, the next time I submit a question, I'll be sure that the fluke answer, if there is one included, can in no way be misconstrued as a possible right answer.
I think some of you are used to trick questions, so you're looking for a sneaky answer.Tue, 01 Mar 2011 14:24:43 GMTmtillman-921105RE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1071589.aspxAmbiguity in the question..!
Answer should be both..
(1) divide by zero/ (2) remainder.Tue, 01 Mar 2011 14:17:51 GMTSQL-DBA-01RE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1071046.aspx[quote][b]SanDroid (2/28/2011)[/b][hr]So happy that over 80 percent of us know math.
Can you imagine how hard it would be a SQL developer or DBA if you didn't learn higher level math?
[/quote]
What's maths got to do with it? The use of % for modulo is a computing term. The mathemetical equivalent would be 'mod', though it's meaning is similar rather than identical.
eg 8 % 6 = 2
means roughly the same as
8 = 2 (mod 6)
or more accurately
8 ≡ 2 (mod 6)
(note it's 25 years since I graduated so I'm probably about to be humilated when someone points out that I'm talking nonsense :-))Tue, 01 Mar 2011 02:25:55 GMTToreadorRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070787.aspxThanks for the nice easy start to the week!Mon, 28 Feb 2011 13:15:08 GMTUMG DeveloperRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070771.aspxthanks for the question - straight forward.Mon, 28 Feb 2011 12:52:37 GMTSQLRNNRRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070640.aspx[quote][b]mtassin (2/28/2011)[/b][hr][quote]
But somebody else could have said "Hey if I modulus 0 by 0 I get a divide by zero error!" and selected the last option, not realizing you were referring to what the % sign looks like.[/quote]
Which would mean nothing unless they could find documentation supporting the obvious wrong answer. It was a multiple choice question with one right answer.
Test taking 101 tells us to select the answer that is MOST correct.
That was answer 3.
I like it when there are joke answers that are funny IF you understand the questions, or what you are reading. It has been proven that these questions improve learning.Mon, 28 Feb 2011 09:59:53 GMTSanDroidRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070636.aspx[quote][b]mtillman-921105 (2/28/2011)[/b]
Yeah, I just included the "To divide by zero and get an error" as a joke. If you look at the symbol and take it at face value, that's what the symbol looks like.
p.s. To be more clear, it looks like a small zero divided by zero: 0/0.[/quote]
Gotta be careful with jokes... as I said, I got this one right.
But somebody else could have said "Hey if I modulus 0 by 0 I get a divide by zero error!" and selected the last option, not realizing you were referring to what the % sign looks like. :)Mon, 28 Feb 2011 09:54:23 GMTmtassinRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070622.aspxI feel so silly for selecting the wrong answer - which was so obviously wrong..I am humbled. Thank goodness it's Monday so I can blame something :-DMon, 28 Feb 2011 09:29:17 GMTBarbWRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070618.aspx[quote][b]sknox (2/28/2011)[/b][hr][quote][b]mtassin (2/28/2011)[/b][hr]I got this right but...
SELECT 0%0
gives
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
So it seems you can use it to divide 0 by 0 and get an error.[/quote]
:-)
This makes sense, since a modulus can be defined as a product of division, you have to be able to do the division. Some systems, though, define x mod 0 as x (i.e, the difference between x and the nearest multiple of 0 [which is 0 (because 0 is the only multiple of 0.)])
[/quote]
Yeah, I just included the "To divide by zero and get an error" as a joke. If you look at the symbol and take it at face value, that's what the symbol looks like.
p.s. To be more clear, it looks like a small zero divided by zero: 0/0.Mon, 28 Feb 2011 09:17:42 GMTmtillman-921105RE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070609.aspx[quote][b]mtassin (2/28/2011)[/b][hr]I got this right but...
SELECT 0%0
gives
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
So it seems you can use it to divide 0 by 0 and get an error.[/quote]
Seriously? :-PMon, 28 Feb 2011 09:08:55 GMTSanDroidRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070608.aspxSo happy that over 80 percent of us know math.
Can you imagine how hard it would be a SQL developer or DBA if you didn't learn higher level math?
Mon, 28 Feb 2011 09:05:57 GMTSanDroidRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070590.aspx[quote][b]mtassin (2/28/2011)[/b][hr]I got this right but...
SELECT 0%0
gives
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
So it seems you can use it to divide 0 by 0 and get an error.[/quote]
:-)
This makes sense, since a modulus can be defined as a product of division, you have to be able to do the division. Some systems, though, define x mod 0 as x (i.e, the difference between x and the nearest multiple of 0 [which is 0 (because 0 is the only multiple of 0.)])
Mon, 28 Feb 2011 08:41:42 GMTsknoxRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070541.aspxI got this right but...
SELECT 0%0
gives
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
So it seems you can use it to divide 0 by 0 and get an error.Mon, 28 Feb 2011 08:02:06 GMTmtassinRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070408.aspxThanks.
It would have been nice to have a shortcut for 0/0 (divide zero by zero) :-).Mon, 28 Feb 2011 04:05:53 GMTanders-731262RE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070386.aspxNice easy one to start of the week, cheers. :-DMon, 28 Feb 2011 02:52:31 GMTDugyCRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070361.aspxNice and easy, good for a Monday morning. Thanks.Mon, 28 Feb 2011 01:36:45 GMTKoen VerbeeckRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070352.aspxeasy one, thanks
IulianMon, 28 Feb 2011 01:04:28 GMTIulian -207023RE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070337.aspxThanks for easy question. :-)Sun, 27 Feb 2011 23:46:33 GMTtejaswini.patilRE: The Percent Sign in T-SQLhttps://www.sqlservercentral.com/Forums/FindPost1070115.aspxEasy one :-DSat, 26 Feb 2011 22:57:45 GMTM&M