Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

how to keep multiple case statement result in same row in sql server

$
0
0

Hello,

I am trying to write a script for test score of match, science ,english. I am using a case statement to achieve this. However, I am getting multiple rows for the test scores for individual student. Is there any way to keep all the testscores in one row. I am sharing my script with you. Please take a look. I am also attaching a screenshot

Text
declare @YR_CDE char(4), @TRM_CDE char(2) SELECT @YR_CDE = 2017, @TRM_CDE = 20 ;with ex as(select ORG_MASTER_ORG_CODE_V.ID_NUM,BUSINESS_NAME,ORG_TYPE from ORG_MASTER_ORG_CODE_V where ORG_TYPE like 'HS') SELECT DISTINCT BIOGRAPH_MASTER.ID_NUM as INST_ID, name_master.first_name as STU_FIRST_NAME, name_master.last_name as STU_LAST_NAME, CONVERT( char(10), biograph_master.birth_dte , 101) as date_of_birth, CASE WHEN (select IPEDS_REPORT_VALUE from ethnic_race_report where id_num =...

Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>