Jump to content

sorting on types


ramsha

Recommended Posts

My table description is as follows

 

**entry_table**

 

 - serial(int)

 - s_name(varchar)

 - user_id(int)

 - id(int)

 

**Students_details**

 

 - id(int)

 - user_id(int)

 - student_name(varchar)

 - adress(varchar)

 

**User_login**

 

 - user_id(int)

 - user_name(varchar)

 - password(varchar)

 - alotment(bool)

 

Scenario is that the students apply for multiple scholarships. Their selections are stored in the entry_table's s_name, user_id and id fields.

 

My next step is to build a sorted list of all the students who applied for a particular scholarship eg:"scholarship1". 

 

 

This list should also show the student's name(student_name field of the students_details table)

 

The lists are to be sorted according to two types of scholarships that the system offers(merit and need). Applicants of the merit scholarship are required to be sorted in descending order using the ratio(obtained marks/ total marks). However, the need scholarship is to be shorted in ascending order as it uses the ratio(family income/no. of non-earning family members)

 

I tried to join my tables using 

 

    

 

        $query = "SELECT *FROM entry_table, students_details 

    WHERE entry_table.id=students_details.id

        group by entry.s_id,entry.student_id";

 

Please help in the sorting as per type problem. Also the above query helps joining the tables but doesnt achieve the purpose.

 

thanking you in advance

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.