Reply to Re: Reusing a generated column to avoid over processing

Your name:

Reply:


Posted by Roy Harvey (SQL Server MVP) on 10/22/07 13:47

One approach is to use a view. Another is to use a derived table. For
SQL Server 2005 there is a third alternative, a Common Table
Expression (CTE).

All three alternatives require writing the query that returns the
computed column and then using that query in any of the three ways. So
we could have something like:

WITH Example AS
(SELECT A, B, C, <complex expression> as Complex
FROM X)
SELECT *
FROM Example
WHERE Complex = '20071225'

Roy Harvey
Beacon Falls, CT

On Mon, 22 Oct 2007 06:06:17 -0700, "brazil.mg.marcus.vinicius.lima"
<marcvlima@gmail.com> wrote:

>Hi,
>
>I'm constructing a query that will performs a lot o datetime
>calculumns to generate columns.
>All that operations are dependent of a base calculum that is performed
>on the query and its result is stored in a columna returned.
>
>I wanna find a way of reusing this generated column, to avoid
>reprocessing that calculumn to perform the other operations, cause
>that query will be used in a critical application, and all saving is
>few.
>
>Thanks a lot.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация