|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, February 04, 2010 9:16 AM
Points: 26,
Visits: 114
|
|
Hello,
I am trying to create a view which gives records. Some of them have the same values over most of the fields. My goal is to group them by these fields. But, I cannot just group by these fields, I would have to group by all the fields in the "select" clause.
I know of a command called "Break on" in Oracle SQL-Plus. This creates a line break when it finds a unique record. So the repeating record gets listed only once. However, this command doesn't seem to be working for SQL Server. I want to know an equivalent of that so that I would have the repeating record listed just once.
Any help on this would be truely appreciated
Thanks Shruti
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 9:20 AM
Points: 8,414,
Visits: 4,711
|
|
I don't believe there is such a function in T-SQL. But I'd also say that this kind of thing should be done in the presentation layer, not in the database. Should be very easy to do in your application, I would think.
- GSquared
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 10:06 PM
Points: 2,478,
Visits: 3,056
|
|
So the repeating record gets listed only once.
This sounds like a SELECT DISTINCT query. It returns only the unique combinations of all columns included in the SELECT list.
__________________________________________________
Data corruption and no backup.... and identity theft by doppelgangers from parallel universes? Look here.
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller Whenever possible, I prefer to eat the rude. -- Hannibal Lecter
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Tuesday, August 11, 2009 11:26 AM
Points: 92,
Visits: 282
|
|
GSquared (4/24/2009) I don't believe there is such a function in T-SQL. But I'd also say that this kind of thing should be done in the presentation layer, not in the database. Should be very easy to do in your application, I would think.
I understand this, but do you the following is possible in T-SQL?
Assume the format of the data is in the following:
A B C D A B C D A B C D A B C D Is there a way to render the output as the following?
A B D C A B D C A B D C A B D C Thanks for any help
|
|
|
|