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 |
selvaspk
Starting Member
3 Posts |
Posted - 2008-12-09 : 10:07:13
|
Hi,I am using Teradata and when i use the MINUS queries,i get a slow performance. But my scenario is i need to compare a lot of fields with other table and writing with MINUS is easy and iis there any alternative i could use instead of that?I am new and struck with this.Thanks in advance.Selva |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-12-09 : 10:22:01
|
Can you explain clearly with queries as well? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-09 : 10:24:10
|
try left join |
|
|
selvaspk
Starting Member
3 Posts |
Posted - 2008-12-09 : 10:27:19
|
quote: Originally posted by sodeep Can you explain clearly with queries as well?
Scenario 1:sel A.C1, A.C2, A.C3, A.C4from table Agroup by 1,2,3,4Minussel B.C1, B.C2, B.C3, B.C4from table Bgroup by 1,2,3,4Scenario 2:in this the C3 and C4 are amount columns.sel A.C1, A.C2, sum(A.C3), sum(A.C4)from table Agroup by 1,2,3,4Minussel B.C1, B.C2, sum(B.C3), Sum(B.C4)from table Bgroup by 1,2,3,4 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-09 : 10:27:32
|
or even not exists will do |
|
|
selvaspk
Starting Member
3 Posts |
Posted - 2008-12-09 : 10:30:45
|
quote: Originally posted by visakh16 or even not exists will do
you mean for the amount col also we can use not exists? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-09 : 10:45:01
|
yup...why not? |
|
|
|
|
|
|
|