Example from
Geography tables
region_name store_name East Boston East New York West Los Angeles West San Diego
Example 1: For MySQL / Oracle:
SELECT CONCAT(region_name,store_name) FROM Geography WHERE store_name = 'Boston'; Result: 'EastBoston'
Example 2: For Oracle:
SELECT region_name || ' ' || store_name FROM Geography WHERE store_name = 'Boston'; Result: 'East Boston'
Example 3: For SQL Server:
SELECT region_name + ' ' + store_name FROM Geography WHERE store_name = 'Boston'; Result: 'East Boston'
Starting from this, you can adapt to two tables without any problems. In doubt, use a virtual table to make things more readable.
If in doubt, check out this other question, which has been answered for more details.
fooobar.com/questions/1402951 / ...
source share