Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Is it possible to quering a query? For example:Select (Field1+Field2+Field3) As [Result1], (Field4+Field5) As [Result2], Field6, Field7 from Table.Is it possible to run a query (selecting Result1 and Result2) against this query.
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts
Posted - 2007-01-11 : 06:11:19
Yes, by creating first query as a derived table.
Select Result1, Result2From(Select (Field1+Field2+Field3) As [Result1], (Field4+Field5) As [Result2], Field6, Field7 from Table) t
Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
SwePeso
Patron Saint of Lost Yaks
30421 Posts
Posted - 2007-01-11 : 06:46:21
Tell us what you really are up to. There is no need to do this simple query with a derived table.Peter LarssonHelsingborg, Sweden
sillylady
Starting Member
13 Posts
Posted - 2007-01-14 : 01:39:15
quote:Originally posted by Peso Tell us what you really are up to. There is no need to do this simple query with a derived table.Peter LarssonHelsingborg, Sweden
As I said in my posting that those Result1 and Result2 will be compared with values from another table filelds and another set of calculation will be done.