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 functionfield cfrom 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 thisSelect field a, field b, GetSomelList(tableA.field z) as Lista, /* Where GetSomeList is a functionfield cfrom 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.