Re: "SUM" of a varchar column?
From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 12/17/04
- Next message: GYK: "Re: spare server not clustered"
- Previous message: Andrew J. Kelly: "Re: Database Backup"
- In reply to: Maury Markowitz: ""SUM" of a varchar column?"
- Next in thread: Maury Markowitz: "Re: "SUM" of a varchar column?"
- Reply: Maury Markowitz: "Re: "SUM" of a varchar column?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 17 Dec 2004 12:17:29 -0500
This looks like a PIVOT. Can you flatten this table out on the client? If
not, see http://www.aspfaq.com/2462
-- http://www.aspfaq.com/ (Reverse address to reply.) "Maury Markowitz" <MauryMarkowitz@discussions.microsoft.com> wrote in message news:7838E3D4-CD8D-46EB-A75F-D069B30EE9AB@microsoft.com... > I have a table that contains a number of columns containing either a varchar > value, or null. There are multiple rows per grouping. I would like to colapse > the multiple rows into a single row, either by appending the strings to each > other, or simply selecting the first (or last) one. > > If it was a number field I could do a SUM, MAX or MIN. SUM doesn't work, for > obvious reasons. I thought MAX would work, but MAX returns only one value for > all of the columns (as opposed to one per column) and the rest are left as > null. > > Any suggestions?
- Next message: GYK: "Re: spare server not clustered"
- Previous message: Andrew J. Kelly: "Re: Database Backup"
- In reply to: Maury Markowitz: ""SUM" of a varchar column?"
- Next in thread: Maury Markowitz: "Re: "SUM" of a varchar column?"
- Reply: Maury Markowitz: "Re: "SUM" of a varchar column?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|