sql - Using the same table in a join -


i using microsoft sample database , questions sqlzoo.net learn sql job. stuck on question:

for every customer 'main office' in dallas show addressline1 of 'main office' , addressline1 of 'shipping' address - if there no shipping address leave blank. use 1 row per customer.

how use same table?

you need alias table join onto itself. example:

select t1.column1, t2.column2, ...  table1 t1 join table1 t2     on t1.column1 = t2.column1 

Comments

Popular posts from this blog

xslt - Substring before throwing error -

Google Cloud Bigtable Durability/Availability Guarantees -

Android M doze mode and "native" posix socket freezing up -