Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Creating semi pivot view from one table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-10-03 : 15:32:08
Co writes "Hi,

I've try to create a query to transform this table:


STUDENT_ID, LAB_NO, CLS_NO, LAB_HOURS
00001521 4 012629 12.85
00002200 4 011995 .25
00002200 4 014137 .25
00002420 4 011750 4.28

To this table:

STUDENT_ID, LAB_NO, MESSAGE_STR
00001521 4 You have 12.85 hrs. in class #012629
00002200 4 You have .25 hrs. in class #011995, .25 hrs. in class #014137
00002420 4 You have 4.28 hrs. in class #011750


Can it be done in one (Non-Dynamic) SQL statement?
Thanks."
   

- Advertisement -