Studetnt Result should get Pass (or) Fail

Hi guys try this query
If any student fails in one subject also his result should be Faile r else Pass
condtion is(marks>=40 "PASS" marks<=40 "FAIL")
s_name marks
ramu 60
ramu 40
ramu 50
karan 30
karan 96
karan 46
o/p: karan Fail
ramu Pass

Questions by Rakesh057   answers by Rakesh057

Showing Answers 1 - 3 of 3 Answers

Dasish

  • Dec 13th, 2014
 

If all the marks are defined in a row with different column then try the below
Select sname, decode( least(m1,m2,...........) >= 40, pass,fail) from student;
If the mark is defined in multiple row in one column the try follow
Select roll, sname, decode(min(mark) >= 40 , pass, fail) from student group by roll, sname;

SOnali

  • Jun 29th, 2016
 

Select Name,
when Min(Mark)>40
Then Pass
Else Fail
End
From TableName
Group By Name

  Was this answer useful?  Yes

nancy

  • Jul 19th, 2016
 

Code
  1. SELECT Name,

  2. when Min(Mark)>40

  3. Then Pass

  4. Else Fail

  5. End

  6. FROM TableName

  7. GROUP BY Name

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions