SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Joining big data tables with like.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pebkacbigdatauser
Starting Member

23 Posts

Posted - 07/02/2012 :  20:26:50  Show Profile  Reply with Quote
edit

Edited by - pebkacbigdatauser on 07/09/2012 15:02:28

LoztInSpace
Aged Yak Warrior

876 Posts

Posted - 07/03/2012 :  04:47:33  Show Profile  Reply with Quote
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 - 07/03/2012 :  18:01:17  Show Profile  Reply with Quote
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

876 Posts

Posted - 07/03/2012 :  18:27:03  Show Profile  Reply with Quote
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 - 07/03/2012 :  20:52:37  Show Profile  Reply with Quote
edit
Hope that helps!

Edited by - pebkacbigdatauser on 07/09/2012 15:02:46
Go to Top of Page

LoztInSpace
Aged Yak Warrior

876 Posts

Posted - 07/10/2012 :  02:16:02  Show Profile  Reply with Quote
No it does not. I can't see anything now.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000