Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2009-05-11 : 12:01:46
|
| Hi,I have 2 tables:Table a:dept_code2122232425table b:dept_code21 2223262728I joined the 2 tables up with full outer join, to bring everything back but its not?select a.dept_codefrom a full outer join b on a.dept_code = b.dept_codeIs there a way to merge the dept_code field from both tables instead of:a.dept_code, b.dept_code21, 2122, 2223, 2324, NULLNULL, 26etcThanks |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-05-11 : 12:03:21
|
| How about using INNER JOIN? |
 |
|
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2009-05-11 : 12:05:06
|
quote: Originally posted by robvolk How about using INNER JOIN?
No, I would the outcome field to list them all,table a:dept_code2122232425table b:dept_code21 2223262728outcomes:dept_code2122232425262728 |
 |
|
|
kira
Starting Member
17 Posts |
Posted - 2009-05-11 : 12:09:03
|
| how about using UNION? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-05-11 : 12:09:42
|
| [code]SELECT dept_codeFROM(SELECT dept_code FROM tableaUNION SELECT dept_code FROM tableb)tORDER BY dept_code[/code] |
 |
|
|
|
|
|