Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Aggregate Table

$
0
0

Hi, 

I am using dummy data and hopefully I can explain what I am trying to do.

My current logic outputs the table below but given that it's only the one record, it's split into 3 rows due to Location being different for each.

Cust_No    Location      Location_North    Location_East    Location_South   Location_West

122           Newcastle            1                       0                        0                        0

122           Norwich              0                        1                        0                        0

122           Exeter                 0                       0                        1                        0

What I would like to see is a table that looks like this -

Cust_No      Location_North    Location_East    Location_South   Location_West

122                  1                          1                       1                     0

Any idea how I can do this please?


Viewing all articles
Browse latest Browse all 7129

Trending Articles



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