Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Assistance with a Summary Query

$
0
0

I have a table that has the following columns:

State County Rep Amount

01 001 100 $300.00

01 001 999 $ 22.50

01 002 300 $750.00

01 002 999 $ 12.75

02 020 400 $450.00

02 020 999 $ 57.00

02 030 111 $645.00

All other rep data is on a separate row with a code of 999.

What I need to do is create output that looks like this:

State County Rep Amount Other Rep Other Amount

01 001 100 $300.00 999 $ 22.50

01 002 300 $750.00 999 $ 12.75

02 020 400 $450.00 999 $ 57.00

02 030 111 $645.00 0 $ 0.00

In other words, I want to place the other rep data beside the Rep data in the table so that there is only 1 row per State/County Combo.

It seems simple but as a novice I need some help.

I appreciate any assistance.

MEG



Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>