Kiran_M
asked on
SQL Server 2005 - Using the derived value in the Select WHERE Condition
I am trying to use the derived value in the Select Statement Where condition as shown below :
Select field a, field b,
GetSomelList(tableA.field z) as Lista, /* Where GetSomeList is a function
field c
from tableA
where some condition AND Lista <> ','
I get the error Lista is not a "table column' as expected because it is dervied
value and not a table column.
I can do this
Select field a, field b,
GetSomelList(tableA.field z) as Lista, /* Where GetSomeList is a function
field c
from tableA
where some condition AND GetSomelList(tableA.field z) <> ','
Is there a better way of do this instead of calling the same function twice in the select statement.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER