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 2008 Forums
 Transact-SQL (2008)
 Joining big data tables with like.

Author  Topic 

pebkacbigdatauser
Starting Member

23 Posts

Posted - 2012-07-02 : 20:26:50
edit

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2012-07-03 : 04:47:33
Why do you need to do a cross join? I can't quite tell from your problem why you can't just do a normal join to PNUM but nor can I quite work out the relation. The fact you have a distinct in there is usually a strong hint you've stuffed up your joining somewhere.
Go to Top of Page

SlinginParts
Starting Member

18 Posts

Posted - 2012-07-03 : 18:01:17
quote:
Originally posted by LoztInSpace

Why do you need to do a cross join? I can't quite tell from your problem why you can't just do a normal join to PNUM but nor can I quite work out the relation. The fact you have a distinct in there is usually a strong hint you've stuffed up your joining somewhere.



Well I chased down the distinct issue, there was a column totally value that I needed to use MAX on to prevent a bunch of duplicates on that. But I'm still not sure how to write the query more efficiently.
Go to Top of Page

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2012-07-03 : 18:27:03
Can you show the tables & relations? I can't work out how you are joining to PNUM.
Your duplicate is still a concern.
Go to Top of Page

pebkacbigdatauser
Starting Member

23 Posts

Posted - 2012-07-03 : 20:52:37
edit
Hope that helps!
Go to Top of Page

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2012-07-10 : 02:16:02
No it does not. I can't see anything now.
Go to Top of Page
   

- Advertisement -