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

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -