Hi All ,
Happy new year to all ,
i got one requirement, for this i am sending my tables structure and also mentioned expected output .
kindly have a look on the below tables structure
CREATE TABLE [dbo].[ACTVCODE](
[actv_code_id] [int] NOT NULL,
[actv_code_type_id] [int] NOT NULL,
[short_name] [varchar](60) NOT NULL,
[actv_code_name] [varchar](120) NULL,
)
INSERT INTO [ACTVCODE] VALUES (8855,2760,'CCPS_T','Miletones')
INSERT INTO [ACTVCODE] VALUES (8856,2761,'CPP','2*70MW power plant')
SELECT * FROM ACTVCODE
CREATE TABLE [dbo].[TASKACTV](
[task_id] [int] NOT NULL,
[actv_code_type_id] [int] NOT NULL,
[actv_code_id] [int] NOT NULL,
[proj_id] [int] NOT NULL,
)
INSERT INTO [TASKACTV] VALUES (571647,2760,'8855',11346)
INSERT INTO [TASKACTV] VALUES (571647,2761,'8856',11346)
SELECT * FROM TASKACTV
SELECT TASKACTV.actv_code_id, ACTVCODE.short_name, ACTVCODE.actv_code_name, TASKACTV.task_id
FROM ACTVCODE INNER JOIN
TASKACTV ON ACTVCODE.actv_code_id = TASKACTV.actv_code_id
task_id short_name short_name1(alias name)
571647 CCPS_T CPP
kindly provide the solution.
Thanks in Advance