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
 General SQL Server Forums
 New to SQL Server Programming
 UNION Vs UNION ALL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pravin14u
Posting Yak Master

India
246 Posts

Posted - 04/22/2008 :  10:23:54  Show Profile  Click to see pravin14u's MSN Messenger address  Send pravin14u a Yahoo! Message  Reply with Quote
Hi All,

I am doing a UNION of 8 views(with 3 million rows in each view approx). I am sure that there is NO DUPLICATE data between the views. SO specifying a UNION ALL would be better than specifying a UNION in this case?

Thanks!

Prakash.P
The secret to creativity is knowing how to hide your sources!

spirit1
Cybernetic Yak Master

Slovenia
11751 Posts

Posted - 04/22/2008 :  10:26:13  Show Profile  Visit spirit1's Homepage  Reply with Quote
yes.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 04/22/2008 :  10:30:25  Show Profile  Reply with Quote
Did you look at all 24 million rows?

In any case, what do you consider dups?

In any case, are you making this a view of views as well?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

pravin14u
Posting Yak Master

India
246 Posts

Posted - 04/22/2008 :  10:33:39  Show Profile  Click to see pravin14u's MSN Messenger address  Send pravin14u a Yahoo! Message  Reply with Quote
I am doing a

Select *,1 from View1
Union all
Select *,2 from View2

etc., So I am sure that wont be any dups!

Yes - i am creating a view from Views!

Prakash.P
The secret to creativity is knowing how to hide your sources!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30276 Posts

Posted - 04/22/2008 :  10:34:43  Show Profile  Visit SwePeso's Homepage  Reply with Quote
I bet the 8 source views derives from same table.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 04/22/2008 :  10:43:24  Show Profile  Reply with Quote
quote:
Originally posted by Peso

I bet the 8 source views derives from same table.



E 12°55'05.25"
N 56°04'39.16"


]

Point being, you should probably just go against the tables

And SELECT *, n is such bad form

http://weblogs.sqlteam.com/brettk/archive/2004/04/22/1272.aspx




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

pravin14u
Posting Yak Master

India
246 Posts

Posted - 04/22/2008 :  11:54:50  Show Profile  Click to see pravin14u's MSN Messenger address  Send pravin14u a Yahoo! Message  Reply with Quote
okay let me explain the scenario,

We are migrating a SQL 2000 Analysis Services to SSAS. The existing design has 8 different partitions(filled through 8 different views) for last 8 quarters. The calculations for each quarter differs and hence we have 8 different views.

Now I could have tried bringing in all the data together but we dont have the time for it. So instead of specifying 8 different fact tables in SSAS, I am trying to bring all the data inside the view and then specify a slicer condition. I am not sure if my explantion makes sense but I can explain in detail if needed.

Thanks for your replies!

Prakash.P
The secret to creativity is knowing how to hide your sources!
Go to Top of Page

vital
Starting Member

12 Posts

Posted - 04/23/2008 :  01:51:18  Show Profile  Reply with Quote
hi all whats diffecult about inner join and union(all)?
are they like same things?

thanks.
Go to Top of Page

pravin14u
Posting Yak Master

India
246 Posts

Posted - 04/23/2008 :  01:57:17  Show Profile  Click to see pravin14u's MSN Messenger address  Send pravin14u a Yahoo! Message  Reply with Quote
Please go through basics of JOINS. UNION and JOINS are entirely different concepts.

Prakash.P
The secret to creativity is knowing how to hide your sources!
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.11 seconds. Powered By: Snitz Forums 2000