Home » SQL & PL/SQL » SQL & PL/SQL » DECODE AND CASE
DECODE AND CASE [message #269222] Fri, 21 September 2007 04:23 Go to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
HI
HOW CAN I USE THIS QUERY
SELECT DECODE (T1.CODE,T2.CODE,T3.CODE)ALL_CODE,
(CASE ALL_CODE WHEN 'T' THEN 'TESTED' WHEN 'IP' THEN 'IN_PROGRESS' ELSE 'DEV' END)STATUS_CODE FROM T1,T2,T3
Re: DECODE AND CASE [message #269225 is a reply to message #269222] Fri, 21 September 2007 04:30 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

refere to the doc's for the the proper syntax of CASE statement.and can you elobrate on what you are trying to do here.


regards,
Re: DECODE AND CASE [message #269228 is a reply to message #269222] Fri, 21 September 2007 04:53 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can't use this query unless you create the tables with the correct columns and datatypes.

Regards
Michel
Re: DECODE AND CASE [message #269231 is a reply to message #269228] Fri, 21 September 2007 04:59 Go to previous messageGo to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
HI
I HAVE NINE TABLE WITH column CODE varchar2(15) in each table
i have many records with value T , IP ,NA IN EACH TABLE
I WANT TO GET THE OUTPUT DATA IN ONE COLUMN WITH CASE AS
WHEN 'T' THEN 'TESTED' WHEN 'IP' THEN 'IN_PROGRESS' .........
Re: DECODE AND CASE [message #269240 is a reply to message #269231] Fri, 21 September 2007 05:50 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
After 90+ posts, you should know by now how to ask a question.
Provide example tables plus insert-statements. Then show the desired output and your query and where it's outcome differs from the desired output.

And stop screaming please.
Re: DECODE AND CASE [message #269243 is a reply to message #269231] Fri, 21 September 2007 06:10 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
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. Use the "Preview Message" button.
Please always post your Oracle version (4 decimals).

KEEP YOUR FINGER OFF THE CAPS key.

Regards
Michel
Re: DECODE AND CASE [message #269293 is a reply to message #269222] Fri, 21 September 2007 09:00 Go to previous message
Bill B
Messages: 1482
Registered: December 2004
Senior Member
and without a where clause, you are going to have a useless cartisian join.
Previous Topic: insert into hints
Next Topic: query explanation
Goto Forum:
  


Current Time: Sun Dec 04 12:44:34 CST 2016

Total time taken to generate the page: 0.16317 seconds