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: 25
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: 64132
Registered: March 2007
Location: Nanterre, France, http://...
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: Thu Dec 08 00:17:08 CST 2016

Total time taken to generate the page: 0.14071 seconds