Question: I have some CSS classes as:

```
  .span9 {
    width: 870px;
  }
  .span4 {
    width: 370px;
  }

```

In another custom CSS file I want to make another CSS class .span9? How do I do this?

The reason is because a DOM element uses .span4 and I want to override this but it must be overridden in a custom external CSS file.

Is this possible?

Answer: 
```
DECLARE @Id AS VARCHAR(50)
SET @Id = 'Apple'

IF @Id IS NULL
BEGIN
    SELECT ID,
           SUM(ISNULL(Total1,0)) AS Total1,
           SUM(ISNULL(Total2,0)) AS Total2,
           SUM(ISNULL(Total3,0)) AS Total3
    FROM   Table
    GROUP BY ID
END
ELSE
    SELECT ID,
           SUM(ISNULL(Total1,0)) AS Total1,
           SUM(ISNULL(Total2,0)) AS Total2,
           SUM(ISNULL(Total3,0)) AS Total3
    FROM   Table
    WHERE  ID = @Id
    GROUP BY ID
BEGIN
END

```

**EDIT**

You may need this instead

```
DECLARE @Id AS VARCHAR(50)
SET @Id = 'Apple'

IF @Id IS NULL
BEGIN
    SELECT ID,
           (SELECT SUM(Total1) FROM Table WHERE ID = T.ID AND SubId = 'Fruit') AS FruitTotal,
           (SELECT SUM(Total2) FROM Table WHERE ID = T.ID AND SubId = 'Veggies') AS VeggiesTotal
           SUM(ISNULL(Total3,0)) AS Total3
    FROM   Table T
    GROUP BY ID
END
ELSE
    SELECT ID,
           (SELECT SUM(Total1) FROM Table WHERE ID = T.ID AND SubId = 'Fruit') AS FruitTotal,
           (SELECT SUM(Total2) FROM Table WHERE ID = T.ID AND SubId = 'Veggies') AS VeggiesTotal
           SUM(ISNULL(Total3,0)) AS Total3
    FROM   Table T
    WHERE  ID = @Id
    GROUP BY ID
BEGIN
END

```
It's similar to what you've already seen - but there's no aggregate for summing across *columns* in a single row. So you just need to do the maths manually:

```
select
    ID,
    SUM(COALESCE(Total1,0)) as FruitTotal,
    SUM(COALESCE(Total2,0)) as VeggieTotal,
    SUM(COALESCE(Total1,0) + COALESCE(Total2,0)) as TotalTotal
from
    [Table]
group by ID

```