Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Multiline select and count

$
0
0

I have a table:

Users        | Difficult
------------------------------
User 1       | Easy
User 2       | Medium
User 1       | Easy
User 2       | Easy
User 2       | Hard
User 1       | Easy
User 1       | Hard

I want to make a select statement to organize the data in this way:

Users        | Easy  | Medium  | Hard
User 1       | 3        | 0           | 1
User 2       | 1        | 1           | 1

How could I do that?

Valdirnm


Viewing all articles
Browse latest Browse all 8428

Trending Articles



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