SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Comparisons with temporary columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

velvettiger
Posting Yak Master

115 Posts

Posted - 04/23/2008 :  18:46:15  Show Profile  Reply with Quote
Hi All,

I was just wondering if any one can tell me if it is possible to do a comparison on a column that is not in the database but a temporary one. I am using sql sever 2000.


E.g

SELECT CardNumber
	,sum(DailyTransactionValue)TotalSpend
from Customer 
where TotalSpend < 399

tkizer
Almighty SQL Goddess

USA
37157 Posts

Posted - 04/23/2008 :  18:53:27  Show Profile  Visit tkizer's Homepage  Reply with Quote
SELECT CardNumber, TotalSpend
FROM (SELECT CardNumber,sum(DailyTransactionValue) AS TotalSpend from Customer group by CardNumber) t
WHERE TotalSpend < 399

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000