sql - is there any `backspace` character in mssql for string? -
Below is the query for a string company description by adding name, address 1 and address 2. And here I am using the concatenate APPT SEP ('') for the This is the issue of the question, because address 1 or address2 is zero. It will spoil the comma before the empty space which I do not want .. If address 1 and address 2 tap, then result will be I have found the answer to this simple argument .. inside the ISNULL () function Note : The name will not give ISNULL () function if the column is zero.
Select name as compdeeatils from Table Companie + ',' + isnull (Address1, '') + ',' + isnull (Address2, ') where id = 4 < / Code>
name, how can I remove it?
Is there any backspace features in mssql ??
Add Coma. Select
name + isnull (',' + 1 address, '') + isnull (',' +2, '') where compounds as compounds ID = 4
NULL in my case. In case the name is also zero, this answer is not applicable.
Comments
Post a Comment