Remove spaces from the string and select that string in SQL Server

In SQL Server, I'm trying to select some records using a row that has a place, so I crop and use, but something is wrong, please correct me where something is missing.

SELECT * FROM projects where str_id=ltrim(rtrim(' artf130 ')) --- No rows selected SELECT * FROM projects where str_id='artf130' -- one row selected 

Update: I copied the first row from the google distribution sheet.

+5
source share
1 answer

Perhaps it was bad. People continue to help. I think that my comment was enough, because I contacted a very similar problem, which received an answer. So here for everyone:

Here you can find the answer to this question.

+2
source

Source: https://habr.com/ru/post/1264017/


All Articles