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)
 pls rewrite my query...

Author  Topic 

PGG123
Yak Posting Veteran

55 Posts

Posted - 2006-11-23 : 11:36:11
Select g.groupname, g.groupdescription, g.groupdatecreated, s.sectionID, s.sectionname,
s.sectiondescription, s.sectiondatecreated
from groups g inner join sections s on g.groupID=s.groupID
Order by g.groupname, s.sectionname

PGG123
Yak Posting Veteran

55 Posts

Posted - 2006-11-23 : 11:40:21
sorry, i hit enter so quickly b4 I finished my question.

I want the query results to display like this. If the groupname is the same then I don't want to display it. For example:
a 123 ...
a 234 ...
a 134...
b aaa

should be returned to me as
a 123
234
134
b aaa
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-11-23 : 11:45:16
not advisable to do this in T-SQL. Do it in your front end application


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-23 : 22:49:25
quote:
Originally posted by PGG123

sorry, i hit enter so quickly b4 I finished my question.

I want the query results to display like this. If the groupname is the same then I don't want to display it. For example:
a 123 ...
a 234 ...
a 134...
b aaa

should be returned to me as
a 123
234
134
b aaa



Where do you want to show data?
If you use reports like Crystal reports, you can make use of Suppress if duplicated feature. Dont try to do the things that should be done in front end application

Madhivanan

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

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-23 : 22:51:05
quote:
Originally posted by khtan

not advisable to do this in T-SQL. Do it in your front end application


KH




Good to hear this from you Tan

Madhivanan

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

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-11-23 : 23:53:28
quote:
Originally posted by madhivanan

quote:
Originally posted by khtan

not advisable to do this in T-SQL. Do it in your front end application


KH




Good to hear this from you Tan

Madhivanan

Failing to plan is Planning to fail




KH

Go to Top of Page
   

- Advertisement -