For example,
declare @name varchar(10)
set @name = 'John'
Here my table:
| name | surname |
|----------|-------------|
| John | Black |
| John | Reese |
| Kevin | Love |
| Lionel | Messi |
i need to fetch John Black! if name is john, then check lastname in one Select query. else fetch the others. Thank you!
i'm sorry, i couldn't clarify myself. Let me try once more.
First, my variable is 'John'. If name is john, i want to fetch the records whose name is John but at the same time i want to update those lastnames into 'BLACK'