Specifically that o
is an example of a table alias
which can optionally be used with AS
also
join Organisation AS o
the h
also contained in the join condition is also a table alias
, something like this
FROM Hospitals AS h
JOIN Organisation AS o (NOLOCK) on o.OrganisationID = h.OrganisationId
In most cases aliases are used to simplify (or shorten) code, and many also view this as making the code more legible. Aliases can on occasion be necessary; for example if using a lookup table more then once in a query the table aliases (L1 & L2 below) becomes essential to differentiate the joined data.
FROM MyDataTable AS D
INNER JOIN MyLookupTable AS L1 D.code1 = L1.lookup_code
INNER JOIN MyLookupTable AS L2 D.code2 = L2.lookup_code
Attitudes regarding use of aliases differ markedly from strong proponents to strong detractors. See this stackoverflow question as an example.