Home
Tool
Json Beautify
Find Web URL
Inventory Management System
Test Mantra RD Service
Calculate your EMI
Project
Inventory Management System
Task Management
Project Management
Mobile Store Management
Money Transfer Tool
Store Management
About Us
Contact
Login
Registration
Search
SQL Server
Get all one column value through the function from the table in sql server.
By
Csharp Code
Apr 25 2020
975 View's
0 Comment's
Like (
0
)
Dislike (
0
)
if you want to get all one column value with comma-separated, you need to create function.
GO
/****** Object: UserDefinedFunction [dbo].[function_coalesce_post_category] Script Date: 25-04-2020 23:58:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
---select [dbo].[function_coalesce_post_category]()
ALTER FUNCTION [dbo].[function_coalesce_post_category]
(
--@postId AS nvarchar(50)
) RETURNS VARCHAR(MAX)
AS
BEGIN
DECLARE @fcm VARCHAR(max);
SELECT @fcm=COALESCE(@fcm + ',', '') + (CAST([tbl_exampleTable].category AS varchar(max)))
FROM tbl_exampleTable
return @fcm
END
The
COALESCE
() function returns the first non-null value in a list.
0 Comment's
Comment Form
Submit Comment
Csharp Code
If opportunity doesn’t knock, build a door.⛩
Popular Post
WPF
How to Use Logger in WPF Application
By
Csharp Code
Jun 07 2022
C-Sharp
Update Specific Users Out of Oce Settings C# with Example
By
Csharp Code
Jun 06 2022
C-Sharp
Retrieve Specified User''s Out of O ce Settings C# with Example
By
Csharp Code
Jun 06 2022
C-Sharp
Large Object Heap compaction C# with Example
By
Csharp Code
Jun 06 2022
C-Sharp
Weak References C# with Example
By
Csharp Code
Jun 06 2022
C-Sharp
Source code in the view C# with Example
By
Csharp Code
Jun 06 2022
Notifications