March 6, 2007 at 9:10 pm
Would Fields Concatenation in the Select Statement of SQL affect the query performance?
Eg:
SELECT FirstName, LastName FROM NamesTable
Vs
SELECT LastName + '-' + FirstName FROM NamesTable
Rply,
ASHOK S
March 6, 2007 at 9:22 pm
What did you find when you tested it to see what happens?
March 6, 2007 at 11:49 pm
It's a part of a complex query.
It sometimes results in 2-3 seconds and sometimes more than 20 seconds.
will that be one of the possibilities of delaying the result?
Thanks
March 7, 2007 at 5:34 am
Try to test just these two statements you posted, on a large table, if there is any difference. My guess is that the difference will be minimal and not worth considering in a complex query, as long as the concatenated name is just output - not part of some condition. But that's just a guess and the best way to find out is to try it
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply