Wednesday, 12 July 2017

Use Of Coalesce


Declare @ID Nvarchar(max)

select @ID = COALESCE(CAST(@ID AS VARCHAR(50)) + ', ','') + CAST(ExpenseCategoryID  AS VARCHAR(50))
from   (select distinct ID
        from   TableName
        ) CategoryID

SELECT @ID AS CategoryID

No comments:

Post a Comment

React Hooks - custom Hook

  v CustomHook Ø React allows us to create our own hook which is known as custom hook. Example – 1 localStorage Demo Step-1 Create ...