Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Renaming fields and combining them into one column

$
0
0
I have a table with the following structure. Ind_Id | First_Name | Last_Name | FootBall | Soccer | Baseball | Basketball | Volleyball | FuseballThe sports columns have 'Y' or 'N' values. I would like to run a query that will pull the First and Last Name along with the sports they play. My vision it that it would look like this:[u]Name [/u]| [u]Sports[/u]Jane Doe | Soccer; Volleyball (given that Soccer and Volleyball have a 'Y' value)Joe Smith | Football; Baseball; Basketball (given that Football, Baseball and Basketball have a 'Y' value)Any help would be great!Thanks

Viewing all articles
Browse latest Browse all 3145

Trending Articles