SQL查询-选择与多个表不同

问题描述:

我必须编写一个SQL查询来获取不同的位置.

我有3个表,即-tblA,tblB和tblC

所有表都包含用于存储位置"的列,但名称不同.
现在我想从这些表中选择不同的位置,有没有办法做到这一点.

tblA包含用于存储位置的"ALocation"列;
tblB包含用于存储位置的"BLocation"列;
tblC包含用于存储位置的"CLocation"列;

I have to write a sql query for fetching distinct locations.

I have 3 tables, namely- tblA, tblB, and tblC

All tables contain a column for storing ''location'' but with different names.
Now i want to select distinct location from these tables is there any way to do this.

tblA contain ''ALocation'' Column for storing location;
tblB contain ''BLocation'' Column for storing location;
tblC contain ''CLocation'' Column for storing location;

Try:

Try:

SELECT  ALocation  from tblA
UNION
SELECT  BLocation  from tblb
UNION
SELECT  CLocation  from tblC