Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

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

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.


SELECT CardNumber
from Customer 
where TotalSpend < 399

Almighty SQL Goddess

38200 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
Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000