Home » SQL & PL/SQL » SQL & PL/SQL » how to query table that only have a value.... (oracle10g)
how to query table that only have a value.... [message #362486] Tue, 02 December 2008 07:36 Go to next message
norshidah
Messages: 2
Registered: December 2008
Location: Malaysia
Junior Member

Haii all..

i want to know how to display that table that only have a value..this is my query..

im also upload the picture that im ready done for it...im just want to remove the null value or 0 value that have in column..



SELECT v.timeid, v.VALUE VALUE, v.insid insid,q.name,DECODE(v.indid, 1702, v.value, 0) as RESPONSETIME,DECODE(v.indid, 1688, v.value, 0) as TOTALBYTES,DECODE(v.value,GREATEST(v.value,95),'NON-COMPLY','COMPLY') as "COMPLIANCE"

FROM twtdatavalues v,twtinstances q

WHERE (v.insid = 12259947)

AND (v.insid = q.id)

AND (v.flag = 1)

AND (v.timeid > 7244640 AND v.timeid <= 7289280)

AND (v.displayrate = 30)

AND (v.indid in (1702,1688))

Re: how to query table that only have a value.... [message #362489 is a reply to message #362486] Tue, 02 December 2008 07:44 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Some of us can't or don't want to downlaod files.
Post this in line.

Before Please read 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 (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Post a test case: create table and insert statements along with the result you want with these data.

Regards
Michel
Re: how to query table that only have a value.... [message #362494 is a reply to message #362486] Tue, 02 December 2008 07:50 Go to previous message
joicejohn
Messages: 327
Registered: March 2008
Location: India
Senior Member
@norshidah

Simply add one more condition to remove the unwanted records. For instance,
WHERE DECODE(v.indid, 1688, v.value, 0) <> 0

will filter out the records wherever the above DECODE Statement returns 0.

Hope this helps.

Regards,
Jo
Previous Topic: tablename or alias as in para and see the table avaible in schema
Next Topic: ORA-00904: invalid identifier on Production
Goto Forum:
  


Current Time: Wed Dec 07 14:54:42 CST 2016

Total time taken to generate the page: 0.05273 seconds