I would like to show the columns of "linked" tables in SQL-Server database.
In my particular case, there are two tables "Loads" and "Locations", linked by Loads.LocationId=Locations.Id
.
I just to work for a company, based on Oracle DB technology, which used the following notation (simple example):
DB_Name.show, Loads.Name, Locations.Name
Thas was called GCC
or TOC
, according to the version. As you see, the link between both tables is not mentioned.
I realise this is not common notation, and now I'm working for an SQL-Server based company, using basic SQL.
In order to show the same data, I need to write something like:
SELECT Loads.Name, Locations.Name FROM Loads, Locations
WHERE Loads.LocationId = Locations.Id
/* I know it's not a good idea to use a WHERE-clause for a join, */
/* but that's not the point here. */
As you can imagine, the tables are set up in such a way that the mentioned join is always applicable, so I'm wondering if there might be a way to configure my database in such a way that I don't always need to mention the WHERE
(or JOIN
clause), every time I write an SQL query.
Is this possible?
Thanks in advance
JOIN
orWHERE
then it does seem to make sense.