Instead of reading the table twice, we only need to read it once and can return one set of results. This query also has the same 30046 logical reads. PIVOT Learn how to use Pivot to do this
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter