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 |
sql_server_dba
Posting Yak Master
167 Posts |
Posted - 2010-12-21 : 02:01:39
|
Hello All,I have million records in table A and million in table B and joining these two tables to get some crazy output for analysis(combining 3 records as a single record). So which ones might be more useful? CASE or PIVOT?Thanks. |
|
yadhu_cse
Constraint Violating Yak Guru
252 Posts |
Posted - 2010-12-21 : 03:49:31
|
Pivot, as it present data in a better way |
 |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2010-12-21 : 06:44:37
|
Without seeing actual data and the results you want, there's no way to answer this question. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-12-21 : 07:03:26
|
CASE is slightly faster and more versatile.All columns created by PIVOT need to be same database, whereas CASE allow different datatype per column. N 56°04'39.26"E 12°55'05.63" |
 |
|
Sachin.Nand
2937 Posts |
Posted - 2010-12-21 : 07:18:29
|
quote: All columns created by PIVOT need to be same database....
I think Peso means datatype.PBUH |
 |
|
|
|
|