|
|
Re: Does Concatenation in SQL query effect performance [message #223143 is a reply to message #223142] |
Wed, 07 March 2007 13:42 |
gintsp
Messages: 118 Registered: February 2007
|
Senior Member |
|
|
Of course it affects performance. Generally every operation affects performance.
BUT
You have even bigger potential problem here because if you think that you are comparing x to x, y to y and z to z, then you are wrong.
Think what if in upper select X = 'AB', Y = 'C', Z = 'D'
and in subselect X = 'A', Y = 'B', Z = 'CD'
You'll get the match, but most probably you don't want that.
Ok, there isn't any problem just use following statement
select * from big
where (owner, name, type) in (
select owner, name, type from big
);
Of course be cautious also with null values and "in" operator!
Gints Plivna
http://www.gplivna.eu
|
|
|
|
|