Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SharkAl
Starting Member
8 Posts |
Posted - 2014-07-30 : 17:01:47
|
Hello all,I have been using SQL for several years but just starting with my exams and have a question I hope someone can clear up.When are brackets best used? To my knowledge they are used if you would like a particular part of your statement queried first. Is this right? When else should they be used?ThanksAlan |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-07-30 : 17:17:41
|
Do you mean square brackets around an object name or parenthesis? Show us an example and use the bold tag for the part in question.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
SharkAl
Starting Member
8 Posts |
Posted - 2014-07-31 : 03:43:50
|
it's ok, I think I have it.If for example you have Select LEFT('ABC', 3) then the parenthesis are used to contain an expression. Is that right?The reason I was confused mainly was because they seem to be used on a number of different occasions, to identify columns, expressions etc. Is a good rule of thumb that they are used to contain expressions? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-07-31 : 12:19:07
|
Not a rule of thumb. It is necessary for functions and also for order of operations.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|