November 3, 2016 at 11:07 pm
Comments posted to this topic are about the item Is order important?
November 3, 2016 at 11:09 pm
This was removed by the editor as SPAM
November 4, 2016 at 3:18 am
I know it's not really the point of your question but
select count(*) from x where n % 6 = 0 and not n % 5=0
😀
November 4, 2016 at 5:44 am
Interesting question and just so happened to have read about this last week!
That's why I always use parenthesis
They also make queries easier to read
Especially with +, -, *, /, ... equations
- Damian
November 4, 2016 at 9:13 am
Thanks, Mike!
BTW, why there are snippets a and c when they are not mentioned in possible replies? Just curious.
November 4, 2016 at 1:43 pm
Thanks Mike! A great way to reinforce the concepts 🙂
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
November 4, 2016 at 6:13 pm
I figured B, though I was struggling with D and was glad that the options were this or not this rather than figuring out the math on D 🙂
----------------------------------------------------
November 7, 2016 at 4:21 am
DamianC (11/4/2016)
Interesting question and just so happened to have read about this last week!That's why I always use parenthesis
They also make queries easier to read
Especially with +, -, *, /, ... equations
I was taught to use parenthesis not only for the compiler but also for the maintainer. Consistently not using parenthesis and relying on precedence leaves an ambiguity whereas someone who consistently uses them is also clear in their intent if they omit them.
Gaz
-- Stop your grinnin' and drop your linen...they're everywhere!!!
November 8, 2016 at 1:15 am
So much reading 😀
Excellent question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 12, 2016 at 11:44 am
Good question and explanation.
In my experience many developers and dbas are unaware of operator precedence for other than arithmetic or boolean operations - perhaps because they pay only lip service to set-oriented thinking. So it's nice to see a queston on precedence for set-oriented operators.
Tom
November 14, 2016 at 9:20 am
Good to know about the precedence, thanks.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply