sql server - equals Test into sql -
i use equals select possible it?
select example
declare @name_surname varchar(200); select (case when (plp.name +' '+ plp.surname) != @name_surname (set @name_surname = (plp.name +' '+ plp.surname)) end) 'lp.',
problem:
(set @name_surname = (plp.name +' '+ plp.surname))
your sql doesn't quite makes sense. seem trying set variable , return value (as "lp.") @ same time. not allowed. here note in documentation:
a select statement contains variable assignment cannot used perform typical result set retrieval operations.
the correct syntax setting variable using select
this:
select @name_surname = (case when (plp.name +' '+ plp.surname) != @name_surname (plp.name +' '+ plp.surname) else @name_surname end)
that is, set
keyword not allowed within select
statement.
Comments
Post a Comment