SELECT cte,
(CONVERT(VARCHAR, manifesto) + ' ' + TIPO) as result
FROM coleta
WHERE result = '567 TRUCK SIDER'
SELECT cte,
(CONVERT(VARCHAR, manifesto) + ' ' + TIPO) as result
FROM coleta
WHERE result = '567 TRUCK SIDER'
The result
field does not actually exist in the table, so to use it in WHERE
you should indicate how the field is formed.
SELECT x.*
FROM (SELECT cte,
(CONVERT(VARCHAR, c.manifesto) + ' ' + c.tipo) as result
FROM coleta c) x
WHERE x.result = '567 TRUCK SIDER'
You can not use Alias names of the proper query in the where clause, so you have to use an auxiliary query so that the result is the same column name, as placed by @Sorack. Or, in the where clause poes the "calculation" column with alias:
ex:
SELECT cte, (CONVERT(VARCHAR, c.manifesto) + ' ' + c.tipo) as result
FROM coleta c
WHERE (CONVERT(VARCHAR, c.manifesto) + ' ' + c.tipo) = '567 TRUCK SIDER'