Jump to content

Query help


gmc1103
Go to solution Solved by Barand,

Recommended Posts

Hi

 

I'm trying to run a query but is not giving me the right values i need

 

I need to run a query to have all classes ordered and the names of that classes ASC

Example

Class A have 20 students

Class B have 18

 

So my query would have to give me

A

Names ASC

B

Names ASC

 

etc

 

This is what i have but with no success

SELECT t1.`idstudent`, t1.`nome`, t1.`numero`, t1.`inscrito`, t1.`estado`, t1.`processo`, t2.`turma`
FROM `esmaior_ca`.`alunos` AS t1 
INNER JOIN `esmaior_ca`.`turma` AS t2 ON (t1.`turma_idturma` = t2.`idturma`) ORDER BY t2.`turma` AND t1.`nome` ASC;

Any help?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.