ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Merge the three fields of table into single field without using Concatenation function in sql.

user-image
تم إضافة السؤال من قبل muthiah m
تاريخ النشر: 2014/02/05
Mohammad Masadeh
من قبل Mohammad Masadeh , SharePoint Lead Developer , Port Customs And Freezone Corporation Dubai

In oracle we do it like this  

select field1 || field2 || field3 as result from tablename;

Ex : select ' current time is '|| sysdate from dual ;

u can use this sytanx in concatenation  fieds

مستخدم محذوف‎
من قبل مستخدم محذوف‎

Use AS

Select Field1,Field2,Field3 As filedMerge

Muhamamd Saqib
من قبل Muhamamd Saqib , Senior Software Engineer / Technical Lead , OT EMR Inc.

Use a function with COALESCE.

 

CREATE FUNCTION [GetFieldsWithID](    @id int)RETURNS varchar(max)ASBEGIN    declare @output varchar(max)    select @output = COALESCE(@output + ', ', '') + alias    from Users    where id = @id    return @outputENDGOSELECT [id], GetFieldsWithID([id])FROM UsersGO

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟