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

how to combine results into one row

$
0
0

Using MSSQL how do i combine results into one row?

I have a a Db of student data. I want to return one row for each student that will have their contact info, contact info for a guardian, and contact info for a second guardian, if it exists.

Like:

studentID, FirstName, LastName, Grade, Guardian1, Guardian1Email, Guardian2, Guardian2Email

There isn't anything in the Db that specifies Guardian #1, or Guardian #2.

Thanks for any advice


Viewing all articles
Browse latest Browse all 4871

Trending Articles



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