Jump to content

ORDER _BY_NOT_WORKING


RON_ron

Recommended Posts

What results are you getting vs what are you expecting to get?

 

Syntactically that line is fine, so your problem probably lies either with the data itself (ie trying to sort numbers stored as VARCHAR), or with how you're processing the results after the query (doing something that alters the order).

 

 

Link to comment
Share on other sites

Are you sure you do not want to group by the category?

 

$query = "SELECT * FROM gift_db2 LEFT OUTER JOIN student_db ON gift_db2.category = student_db.name GROUP BY  gift_db2.category ORDER BY gift_db2.grade DESC";

 

Not knowing how it is not displaying right, just a shot in the dark.

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.