Help my Sql Queries

  • Thread starter Thread starter vincentmca
  • Start date Start date
V

vincentmca

hi,
Help my queries.

My table name student

following the fields

clss name cast
1 ram sc
1 ravi st
1 arun sc
1 siva obc
1 maha obc
2 ravi st
2 kumar obc

i want this type of out put

class sc st obc
1 2 1 2
2 0 1 1

how to get this output
Pls anybody help me.urgent?

by
vinci manaparai.
 
Create a new query and select the Crosstab Query option. This should launch a
wizard and you should be able to follow it OK to achieve your query results.
 
Hi -

Create a new query, selecting the crosstab wizard.
You'll have to play with it a little bit to get the format as you desire.
Finished product will look something like:

TRANSFORM Count(tblStudent.name) AS [The Value]
SELECT tblStudent.clss
FROM tblStudent
GROUP BY tblStudent.clss
PIVOT tblStudent.cast;

HTH - Bob
 
Back
Top