all groups > sql server new users > january 2006 >
You're in the

sql server new users

group:

need SQL help


need SQL help _adrian
1/8/2006 3:56:51 PM
sql server new users:
OK.. I"ve pretty much got the basics I need for most of my SQL needs..
however.. I need to do the following..

I've got two columns.. one we'll call colors.. and one we'll call numbers...
What I need to do, is to take the following values:

Colors Numbers
------ ----------
Red 1
Red 2
Red 3
Blue 4
Blue 5
Blue 6

.....and SELECT and then order them on my web page (I'm using VBScript/ASP)
so that they display like this:

RED
-----
1
2
3

Blue
----
4
5
6

I can place and lay out the recordsets retrieved from the dabatase fine..
problem is, I don't know how to write the code so that it gives me the
Color only once, followed by each of the rows.. right now, I get:

Red
----
1

Red
----
2 etc.... help?

Re: need SQL help Adam Machanic
1/8/2006 9:00:02 PM
Why do you need the color "only once"? Can't your application code just
look for a change in the value of that column?


--
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--


[quoted text, click to view]

AddThis Social Bookmark Button