General information
Forum:
Microsoft SQL Server
Title:
Specifing a column in the where clause
In this example:
select customer_id,customer_nme,(select sum(sell_amount) from sales where sales.customer_id=customer.customer_id) as sales_total
from customer
where sales_total>0
order by 3,2 desc
Why do I get the error message: Invalid column name 'sales_total'?
Is there a way around this without having to repeat the query in the where command (similar to the order command where you just specify the column number)?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only