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

```
Unless I'm missing something, you just need three `SUM`s:

```
SELECT ID, SUM(Total1), SUM(Total2), SUM(Total3)
FROM myTable
GROUP BY ID

```

[SQL Fiddle example](http://www.sqlfiddle.com/#!6/7cb16/1)