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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 weird join result

Author  Topic 

jgrant
Yak Posting Veteran

69 Posts

Posted - 2007-03-21 : 18:47:38
I am using this query to create a single transactions from data that is distributed over several databases. So essentially i have created several variable tables and now I have to join them together.
So what I wanted to have happen was display all rows from temptalbel and then join the other tables to create one transaction row. The problem that occurs is within the where statement and I dont understand why. In some cases, you can have two instances of x but y will be different. In that case the joins work perfectly. In the event that there are only a single instance of x associated with a single instance of y this join does not work. Can anyone help me understand why this is happening?

select somedata, somedata, somedata, somedata
From kpi..temptablel l
left outer join @temps s on l.x = s.x
left outer join @tempf f on l.x = f.x
left outer join kpi..temptablee e on l.x = e.x
left outer join @tempn n on l.x = n.x

where l.y = s.y and l.y = f.y and l.y = e.y and l.y = n.y


The Yak Village Idiot

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-03-21 : 20:35:55
You already posted this question and already got a response. If you want people to help you out here, you should probably not ignore them when they take the time to try to help you out.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81014

Also, it would be helpful if you provide specific information and a little bit of sample data so that you can demonstrate the problem you are having. At this point, people are trying to figure out the question; it is much easier if you provide a clear question and we can focus on helping you with the *answer*.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -