Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Query to Display Data for SalesMen

$
0
0
I have 3 salesmen, each who cover a few states.  I want to build one query that displays the data for each salesmen, but can't figure out how to build ONE query that does this.  Mike covers the states (FL, GA, AL, MS) - Joe covers (TX, TN, MN, WV) - Bob covers (UT, AR, OK, VA) My thought for this was something along the lines of
Select salesman, count(case where state in ('UT', 'AR', 'OK', 'VA') then ID else null end), count(case where shipped Is Not Null then ID else null end)
From RegionalDatabase


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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