SQL problem

Results 1 to 2 of 2

Thread: SQL problem

  1. #1
    Join Date
    Dec 1969

    Default SQL problem

    I am working for a schooling project.<BR>I have a database in whick I have student&#039;s obtained marks, total marks,<BR>percentages etc. Classes & sections are also there. <BR>I need 2 solutions.<BR><BR>1. With respect to their classes AND sections I wanna assign them their class positons like first,second,third fourth etc. The number of students are in tens of thousands. I DONT NEED RUNNING A LOOP. Is their sql command to do it in a direct step for me.<BR><BR>2. As their percentages are also there. i have maintanied another database to store grades etc (%age based). Like 90% or above is A+ etc.<BR>WITHOUT LOOP, I need the data to be updated, i mean grades must be assigned to them in a sigle sql command without loop.<BR><BR>The grade and class position are in the same database.<BR><BR>Plz help!<BR>Bye!<BR>MIMalik

  2. #2
    Join Date
    Dec 1969

    Default CASE WHEN

    You might want to check the CASE funtion in the SQL books. It works something like this:<BR><BR>UPDATE ...<BR>SET field = CASE Percentage (<BR> WHEN &#062;90 THEN A<BR> WHEN &#060;10 THEN F)<BR><BR>The syntax might not be comletly good, but I think this is what you&#039;re looking for.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts