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

Syntax question - columns noted in parentheses?

$
0
0

I found this query somewhere on the web, copied it to my notebook but part of it I never understood - why the two columns in parentheses? What does that accomplish?

select x.employeeid, y.thecount
    from humanresources.employee x
    join
    (
        select p.managerid, count(*)
        from humanresources.employee p
        group by p.managerid
    ) y (managerid, thecount) on y.managerid = x.managerid -


Viewing all articles
Browse latest Browse all 7129

Trending Articles



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