Home » SQL & PL/SQL » SQL & PL/SQL » Help required with query
Help required with query [message #296164] Thu, 24 January 2008 23:23 Go to next message
aslme
Messages: 26
Registered: May 2006
Location: Pakistan
Junior Member

Class TABLE

SNO
TNO
MARKS
GRADE


TERM TEBLE

TNO
TERM
TERMSTATUS

SELECT * FROM TERM

TNO TERM TS
--- ---------- ---
26 SPRING 2006
27 SUMMER 2006
28 FALL 2006
0 EXEMPTIONS
29 SPRING 2007
30 SUMMER 2007
31 FALL 2007
32 SPRING 2008 C

Query is
SELECT C.SNO, T.TERM, C.MARKS, C.GRADE
FROM CLASS C, TERM T
WHERE T.TNO = C.TNO;

SNO TNO MA GR
--- --- -- --
1888 26 91 A
1888 26 49 F
1888 27 61 C
1888 27 86 A
1888 28 81 B+
1888 28 85 A
1888 28 82 B+
1888 28 83 B+
1888 29
1888 29 75 B
1888 30
1888 30


I want a Condition that if the TERMSTATUS IS 'C' MARKS not shown in the Result but SNO, TNO were shown like this
SNO TNO MA GR
--- --- -- --
1888 26 91 A
1888 26 49 F
1888 27 61 C
1888 27 86 A
1888 28 81 B+
1888 28 85 A
1888 28 82 B+
1888 28 83 B+
1888 29
1888 29
1888 30
1888 30

Please Help me in This Regards


Cheers
Re: Help Required in Query [message #296173 is a reply to message #296164] Thu, 24 January 2008 23:58 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member


Try DECODE

Thumbs Up
Rajuvan.
Re: Help Required in Query [message #296180 is a reply to message #296164] Fri, 25 January 2008 00:37 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Once again, please read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code.
Use the "Preview Message" button to verify.
Always post your Oracle version (4 decimals).

Regards
Michel
Previous Topic: Data Migration - Commit Frequency
Next Topic: How to view indirect dependecies
Goto Forum:
  


Current Time: Fri Feb 07 21:02:22 CST 2025