Luis Cazares (11/12/2015)
Jason-299789 (11/12/2015)
The best way would be to use the CROSS TAB method, mentioned in this article : http://www.sqlservercentral.com/articles/T-SQL/63681/Will the number of columns be limited to 3 or will it depend on the data, ie if there are 4 cities does it have to be 4 wide?
Also your Input and output data do not correspond to each other which means theres a possible typo or we are missing data, in which case we would need the full dataset.
Edit : Beat me to it Lui 😀
You wrote a longer post. I would have spent more time on this, but if the OP won't even care to post adequately, why would I? 😀
😀
_________________________________________________________________________
SSC Guide to Posting and Best Practices