General information
Forum:
Microsoft SQL Server
>Hi,
>
>Somebody knows if it is possible to do a condition with an alias column ???
>
>Here's a sample:
>
>select A_NO_AN = BDD.NO_AN from budg_dem_det bdd where A_NO_AN = 1999
>
>I got this error message:
>Msg 207, Level 16, State 2
>Invalid column name 'A_NO_AN'.
If you're assigning the value to a variable, you need to start A_NO_AN as @A_NO_AN. If you want a column named A_NO_AN try:
BDD.NO_AN "A_NO_AN"
from budg_dem_det bdd
where A_NO_AN = 1999
Previous
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