Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Nesting Functions in Oracle 10g SQL

Status
Not open for further replies.

SJohnE

Technical User
Nov 3, 2009
25
0
0
US
Greetins,
I am trying to build a query that displays a value based on the values of a couple of fields.
Similar to:
iif([Material_Type] = "Bulk Materials",iif([Material_ID] like "PVV*","Bulk Pipe",iif([Material_Type] = "Bulk Materials",iif([Material_Type] Like "FBB*","Bulk Hanger")) as "Bulk Hanger"

Having troubles converting this to sequal. I have:
DECODE (dv.Material_Type,"Bulk Materials",Decode(instr(dv.Material_ID,Not like 'P',1,1),decode(instr(dv.Material_ID,<>'FBB',1,3),"Y"))) as 'Bulk Hanger'

As you can see I tried 'Not Like' and '<>', I've even tried '!='. None seem to work, keep getting missing operator, or invalid SQL statement.

Can anyone help?
 
It might be easier to forget translating, because after all there might be a bug in the original, or the translation, or both.

It would help if you could post the create table statemetn for the table in question, and some insert statements for some sample rows. Then an English language narrative of what you want. That way we can try and go directly to the best SQL.

Regards

T
 
Thanks for you suggestion on this, I actually did figure it out. It was some misplacements of Parenthesis.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top