October 15, 2018 at 2:50 am
I dont understand the red marked part in my book.
Is this query correct ?
book is using live e , live m . Why its used twice ?
Could you please explain whats going on here ?
October 15, 2018 at 6:47 am
When was that book written, the early 90's? JOIN syntax is almost 30 years old at this stage; if that is the format of query your book is teaching you I'd recommend getting a new (and more recent) one.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
October 15, 2018 at 6:51 am
spectra - Monday, October 15, 2018 2:50 AMI dont understand the red marked part in my book.
Is this query correct ?
book is using live e , live m . Why its used twice ?Could you please explain whats going on here ?
The table is referenced twice with two different aliases (e and m).
The e is for the employee details and the m is for the manager details.
October 15, 2018 at 7:31 am
Jonathan AC Roberts - Monday, October 15, 2018 6:51 AMspectra - Monday, October 15, 2018 2:50 AMI dont understand the red marked part in my book.
Is this query correct ?
book is using live e , live m . Why its used twice ?Could you please explain whats going on here ?
The table is referenced twice with two different aliases (e and m).
The e is for the employee details and the m is for the manager details.
its given live m.
so m is not for manager details. its for employee details . is not it ?
October 15, 2018 at 7:33 am
Thom A - Monday, October 15, 2018 6:47 AMWhen was that book written, the early 90's? JOIN syntax is almost 30 years old at this stage; if that is the format of query your book is teaching you I'd recommend getting a new (and more recent) one.
Could not get you.
do you mean that query is wrong ?
What is the correct version ?
October 15, 2018 at 7:34 am
Thom A - Monday, October 15, 2018 6:47 AMWhen was that book written, the early 90's? JOIN syntax is almost 30 years old at this stage; if that is the format of query your book is teaching you I'd recommend getting a new (and more recent) one.
Heh... maybe not... I've seen worse in some current day books and online articles.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 15, 2018 at 7:43 am
spectra - Monday, October 15, 2018 7:33 AMThom A - Monday, October 15, 2018 6:47 AMWhen was that book written, the early 90's? JOIN syntax is almost 30 years old at this stage; if that is the format of query your book is teaching you I'd recommend getting a new (and more recent) one.Could not get you.
do you mean that query is wrong ?What is the correct version ?
It's not that it's "wrong" per say, just that's it uses very old syntax, specifically the ANSI-89 (the 89 stands for the year 1989) JOIN syntax. Aaron Bertrand did an article on it years ago, which you can find here.
But, that query won't actually run anyway. The FROM clause makes reference to the object manager without an alias, however, the rest of the statement refers the the object managers. managers will return an invalid object name. Also, the line break between managers. and the column name will generate a syntax issue.
In truth, there's a few problems with that query.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
October 15, 2018 at 7:44 am
spectra - Monday, October 15, 2018 7:31 AMJonathan AC Roberts - Monday, October 15, 2018 6:51 AMspectra - Monday, October 15, 2018 2:50 AMI dont understand the red marked part in my book.
Is this query correct ?
book is using live e , live m . Why its used twice ?Could you please explain whats going on here ?
The table is referenced twice with two different aliases (e and m).
The e is for the employee details and the m is for the manager details.its given live m.
so m is not for manager details. its for employee details . is not it ?
or this is printing mistake ? should it be manager m instead of live m ?
No, e is for the employee details and m is for the manager details. There is no alias provided for the manager table. The manager table only has the name of the employee and their manager. It does not have the address details.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 15, 2018 at 7:51 am
Thom A - Monday, October 15, 2018 7:43 AMspectra - Monday, October 15, 2018 7:33 AMThom A - Monday, October 15, 2018 6:47 AMWhen was that book written, the early 90's? JOIN syntax is almost 30 years old at this stage; if that is the format of query your book is teaching you I'd recommend getting a new (and more recent) one.Could not get you.
do you mean that query is wrong ?What is the correct version ?
It's not that it's "wrong" per say, just that's it uses very old syntax, specifically the ANSI-89 (the 89 stands for the year 1989) JOIN syntax. Aaron Bertrand did an article on it years ago, which you can find here.
But, that query won't actually run anyway. The FROM clause makes reference to the object manager without an alias, however, the rest of the statement refers the the object managers. managers will return an invalid object name. Also, the line break between managers. and the column name will generate a syntax issue.
In truth, there's a few problems with that query.
You can put a spaces or linefeeds between the dot and the column name. Not that I ever do it but it still works.
October 15, 2018 at 7:58 am
Jonathan AC Roberts - Monday, October 15, 2018 7:51 AMThom A - Monday, October 15, 2018 7:43 AMspectra - Monday, October 15, 2018 7:33 AMThom A - Monday, October 15, 2018 6:47 AMWhen was that book written, the early 90's? JOIN syntax is almost 30 years old at this stage; if that is the format of query your book is teaching you I'd recommend getting a new (and more recent) one.Could not get you.
do you mean that query is wrong ?What is the correct version ?
It's not that it's "wrong" per say, just that's it uses very old syntax, specifically the ANSI-89 (the 89 stands for the year 1989) JOIN syntax. Aaron Bertrand did an article on it years ago, which you can find here.
But, that query won't actually run anyway. The FROM clause makes reference to the object manager without an alias, however, the rest of the statement refers the the object managers. managers will return an invalid object name. Also, the line break between managers. and the column name will generate a syntax issue.
In truth, there's a few problems with that query.
You can put a spaces or linefeeds between the dot and the column name. Not that I ever do it but it still works.
Some people do this as part of their "personal formatting preference". It makes the code look very weird and hard to scan. These people should always be re-educated, forcibly if necessary.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 15, 2018 at 8:00 am
Jonathan AC Roberts - Monday, October 15, 2018 7:51 AMYou can put a spaces or linefeeds between the dot and the column name. Not that I ever do it but it still works.
Oh you're right... WHY!? (What have I done to have been introduced to such awful formatting? I can't unsee it now, ahhh!!!)
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
October 15, 2018 at 11:04 am
Thom A - Monday, October 15, 2018 8:00 AMJonathan AC Roberts - Monday, October 15, 2018 7:51 AMYou can put a spaces or linefeeds between the dot and the column name. Not that I ever do it but it still works.Oh you're right... WHY!? (What have I done to have been introduced to such awful formatting? I can't unsee it now, ahhh!!!)
Need some brain bleach?
October 15, 2018 at 11:09 am
Brandie Tarvin - Monday, October 15, 2018 11:04 AMThom A - Monday, October 15, 2018 8:00 AMJonathan AC Roberts - Monday, October 15, 2018 7:51 AMYou can put a spaces or linefeeds between the dot and the column name. Not that I ever do it but it still works.Oh you're right... WHY!? (What have I done to have been introduced to such awful formatting? I can't unsee it now, ahhh!!!)
Need some brain bleach?
You can do the same thing with dot notation in VB.NET and C#.
October 15, 2018 at 12:20 pm
ChrisM@Work - Monday, October 15, 2018 7:58 AMJonathan AC Roberts - Monday, October 15, 2018 7:51 AMThom A - Monday, October 15, 2018 7:43 AMspectra - Monday, October 15, 2018 7:33 AMThom A - Monday, October 15, 2018 6:47 AMWhen was that book written, the early 90's? JOIN syntax is almost 30 years old at this stage; if that is the format of query your book is teaching you I'd recommend getting a new (and more recent) one.Could not get you.
do you mean that query is wrong ?What is the correct version ?
It's not that it's "wrong" per say, just that's it uses very old syntax, specifically the ANSI-89 (the 89 stands for the year 1989) JOIN syntax. Aaron Bertrand did an article on it years ago, which you can find here.
But, that query won't actually run anyway. The FROM clause makes reference to the object manager without an alias, however, the rest of the statement refers the the object managers. managers will return an invalid object name. Also, the line break between managers. and the column name will generate a syntax issue.
In truth, there's a few problems with that query.
You can put a spaces or linefeeds between the dot and the column name. Not that I ever do it but it still works.
Some people do this as part of their "personal formatting preference". It makes the code look very weird and hard to scan. These people should always be re-educated, forcibly if necessary.
Hmmmm.... pork chop opportunity. π
--Jeff Moden
Change is inevitable... Change for the better is not.
October 15, 2018 at 12:25 pm
Jeff Moden - Monday, October 15, 2018 12:20 PMChrisM@Work - Monday, October 15, 2018 7:58 AMJonathan AC Roberts - Monday, October 15, 2018 7:51 AMThom A - Monday, October 15, 2018 7:43 AMspectra - Monday, October 15, 2018 7:33 AMThom A - Monday, October 15, 2018 6:47 AMWhen was that book written, the early 90's? JOIN syntax is almost 30 years old at this stage; if that is the format of query your book is teaching you I'd recommend getting a new (and more recent) one.Could not get you.
do you mean that query is wrong ?What is the correct version ?
It's not that it's "wrong" per say, just that's it uses very old syntax, specifically the ANSI-89 (the 89 stands for the year 1989) JOIN syntax. Aaron Bertrand did an article on it years ago, which you can find here.
But, that query won't actually run anyway. The FROM clause makes reference to the object manager without an alias, however, the rest of the statement refers the the object managers. managers will return an invalid object name. Also, the line break between managers. and the column name will generate a syntax issue.
In truth, there's a few problems with that query.
You can put a spaces or linefeeds between the dot and the column name. Not that I ever do it but it still works.
Some people do this as part of their "personal formatting preference". It makes the code look very weird and hard to scan. These people should always be re-educated, forcibly if necessary.
Hmmmm.... pork chop opportunity. π
ahhhh.. reminds me of a COBOL programmer on a client of mine many years ago.
In order to keep his position "safe" he named all variables with a combination of 3 or 4 letters/numbers
AAA1 - invoice number
AAA2 - Invoice date
XYZ2 - customer name
and what each combination meant was only known to himself - and kept away from everyone.
personal taste taken to extremes.
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply