Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query presentation in 2-D format

Status
Not open for further replies.

database1

Technical User
May 15, 2000
8
IN
&nbsp;&nbsp;&nbsp;The table contains Department,Grade,status. <br>How to obtaine the below output<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Dept/Grade&nbsp;&nbsp;&nbsp;&nbsp;G1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;G2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;G3 <br>&nbsp;&nbsp;&nbsp;&nbsp;D1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2 <br>&nbsp;&nbsp;&nbsp;&nbsp;D2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5 <br>&nbsp;&nbsp;&nbsp;&nbsp;D3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6 <br>The matrix represents the count of status with respect to <br>department and grade.<br>Can this be obtained using groupby statement?<br>Please avoid cursors.<br>Can a query return output in 2-D format.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top