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)
 Formating the results of a query in a specific way

Author  Topic 

Pereayel
Starting Member

6 Posts

Posted - 2006-05-10 : 12:07:50
Hi all,

I'm new to this forumn and need your help. Below is the query that I am running and under it is the resulting table.

SELECT DISTINCT school.schoolID, field.[name],
degree. [name] AS degree, degree.degreeID,
field.fieldID
FROM school_field INNER JOIN
school_field_degree ON school_field.schoolID = school_field_degree.schoolID AND
school_field.fieldID = school_field_degree.fieldID INNER JOIN
school ON school_field.schoolID = school.schoolID INNER JOIN
degree ON school_field_degree.degreeID = degree.degreeID INNER JOIN
field ON school_field.fieldID = field.fieldID
WHERE school.schoolID = 136 AND school.siteID = 7
ORDER by school.schoolID
---------------------------------------------------------
result
----------------------------------------------------------
136 Early Childhood Education Bachelors 2 48
136 Education Bachelors 2 51
136 Education Masters 3 51
136 Elementary Education Bachelors 2 52

----------------------------------------------------------
Myquestion is how can I format the result to look like the one below? Thanks


136 Early Childhood Education Bachelors
136 Education Bachelors Masters
136 Elementary Education Bachelors

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2006-05-10 : 12:45:37
Hi Pereayel,

See this link for advice how to explain your problem so you can get answers quick:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

It would be great if you could post 2 and 3 - as well as the 1, 4 and 5 you've already posted


Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-05-11 : 03:05:41
Refer this
http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx?Pending=true

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -