R
Roy Gourgi
Hi,
Is there a way to group rows by some columns in such a way that I can
clearly see them in a distinguished fashion when I look at a view or table.
This is my code below but when I try using GROUP BY it is not giving me the
desired effect that I would like?
For example, let's say I would like to group by the first 5 columns (i.e.
V1,V2,V3,V4,V5) and let's say the first 3 rows of my view or table contain
the values 1,2,3,4,5 for V1,V2,V3,V4,V5 respectively, and the next 3 rows
contain the values 1,2,3,4,6 for V1,V2,V3,V4,V5 respectively and so on. What
I would like to see when I look at my view or table, is some sort of visible
delineation or break of some sort by the grouping that I chose, so that I do
not have to do it visually myself because I have many records in my view.
See my view below with the 6 rows as an example.
SELECT TOP (100) PERCENT V1, V2, V3, V4, V5, V6, V7, V8, V9, V10
FROM dbo.tblNo1
WHERE (MP <= 30)
ORDER BY V1, V2, V3, V4, V5
These are the 6 rows in my table and so as you can see the first 3 rows
would be in one group and the next 3 rows would be in another group. What I
would like to do is have to sort of way to show a distinction or highlight
between the first 3 rows and the next 3 rows.
1,2,3,4,5, 8,9,11,13,16
1,2,3,4,5, 9,11,12,15,17
1,2,3,4,5, 11,15,19,21,23
1,2,3,4,6, 8,9,12,15,18
1,2,3,4,6, 9,12,16,18,21
1,2,3,4,6, 13,16,19,20,21
TIA
Roy
Is there a way to group rows by some columns in such a way that I can
clearly see them in a distinguished fashion when I look at a view or table.
This is my code below but when I try using GROUP BY it is not giving me the
desired effect that I would like?
For example, let's say I would like to group by the first 5 columns (i.e.
V1,V2,V3,V4,V5) and let's say the first 3 rows of my view or table contain
the values 1,2,3,4,5 for V1,V2,V3,V4,V5 respectively, and the next 3 rows
contain the values 1,2,3,4,6 for V1,V2,V3,V4,V5 respectively and so on. What
I would like to see when I look at my view or table, is some sort of visible
delineation or break of some sort by the grouping that I chose, so that I do
not have to do it visually myself because I have many records in my view.
See my view below with the 6 rows as an example.
SELECT TOP (100) PERCENT V1, V2, V3, V4, V5, V6, V7, V8, V9, V10
FROM dbo.tblNo1
WHERE (MP <= 30)
ORDER BY V1, V2, V3, V4, V5
These are the 6 rows in my table and so as you can see the first 3 rows
would be in one group and the next 3 rows would be in another group. What I
would like to do is have to sort of way to show a distinction or highlight
between the first 3 rows and the next 3 rows.
1,2,3,4,5, 8,9,11,13,16
1,2,3,4,5, 9,11,12,15,17
1,2,3,4,5, 11,15,19,21,23
1,2,3,4,6, 8,9,12,15,18
1,2,3,4,6, 9,12,16,18,21
1,2,3,4,6, 13,16,19,20,21
TIA
Roy