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 |
|
npk
Starting Member
3 Posts |
Posted - 2007-12-12 : 05:35:07
|
| Hello,I have a problem figuring out how I should do the following in SQL. I have 2 tablestable 1M_Name, M_ApplicationA applAb applBc NULLd applDtable 2O_Name, O_ApplicationA applAb applXXc applCd NULL Now I need to somehow combine this to tables where M_Name and O_name should be the where clause e.g. where M_name = O_name and the resultshould look something like thisName (M_name and O_name), M_Application, O_ApplicationA ApplA ApplAB ApplB ApplXXC NULL ApplCD ApplD NULL I also would like to have NULLS included in the resultThanks,Patric |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-12 : 05:55:49
|
Use the force INNER JOIN, Luke Patric. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
npk
Starting Member
3 Posts |
Posted - 2007-12-12 : 06:21:34
|
| thanks PesoSQL:select mispPartnerName, mispApplicationName from misp m inner join oasys o ON m.mispPartnerName = o.oasysPartnerNameunfortunately I only get the mispPartnerName, mispApplicationName in the result, I would also like to have the o.oasysApplicationName (which is also in the oasys table) included. Do you know how this is done.thanks,patric |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-12 : 06:27:15
|
Yes, but this is not necessary since m.mispPartnerName equals o.oasysPartnerName beause you are binding the two tables over these columns.select m.mispPartnerName, m.mispApplicationName, o.oasysPartnerNamefrom misp as minner join oasys as o ON o.oasysPartnerName = m.mispPartnerName E 12°55'05.25"N 56°04'39.16" |
 |
|
|
npk
Starting Member
3 Posts |
Posted - 2007-12-12 : 06:49:48
|
| thanks for your help. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-12 : 07:08:09
|
something similar toselect m.mispPartnerName, m.mispApplicationName, o.oasysApplicationNamefrom misp as minner join oasys as o ON o.oasysPartnerName = m.mispPartnerName E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|
|
|