Re: Calculated field in a calculation.
anonymous_at_discussions.microsoft.com
Date: 05/03/04
- Previous message: Steve Kass: "Re: Could not allocate ancillary table for view resolution"
- In reply to: Vishal Parkar: "Re: Calculated field in a calculation."
- Next in thread: Steve Kass: "Re: Calculated field in a calculation."
- Reply: Steve Kass: "Re: Calculated field in a calculation."
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 3 May 2004 12:10:35 -0700
So, what does one do in SQL server when one wants to
create a view or stored procedure from an Access query
whose SQL statement runs 4 or 5 pages with many calculated
fields using other calculated fields. The only solution
seems to be to include the formula for any calculated
expression in the calculation that uses it. Is this really
the way extremely complex SQL statments are handled?
>-----Original Message-----
>hi lind,
>
>In RDBMS theory the computed expressions that are used in
the SELECT
>statements like
>
>select (col1+col2) as 'exp1', (col3+col4) as 'exp2'
>
>gets executed all at the same time and not one after
another. Hence one
>expression is not visible to other expression. Access
handles these kind of
>"query expressions" in different way, you really can not
compare SQL written
>in Access and SQL Server.
>
>You can only reference these kind of expressions in Order
by clause.
>
>Ex:
>use northwind
>go
>select customerid + 'x' as 'cusid'
>from customers
>order by cusid
>
>--but following will be errored out.
>use northwind
>go
>select customerid + 'x' as 'cusid', cusid + 'y'
as 'cusid2'
>from customers
>
>The work around would be to use derived tables.
>
>Ex:
>use northwind
>go
>select cusid,cusid + 'y' as 'cusid2'
>from
>(select customerid + 'x' as 'cusid'
>from customers) DerivedTable --this is evaluated as
derived table
>
>
>--
>Vishal Parkar
>vgparkar@yahoo.co.in
>
>
>.
>
- Previous message: Steve Kass: "Re: Could not allocate ancillary table for view resolution"
- In reply to: Vishal Parkar: "Re: Calculated field in a calculation."
- Next in thread: Steve Kass: "Re: Calculated field in a calculation."
- Reply: Steve Kass: "Re: Calculated field in a calculation."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|