Saturday, February 25, 2012

clike

hello
in mysql exist the operator clike that there is similar of like but there isn't key-sensitive. In oracle there is a similar operator?
And there is an operator similar of the function iif of access?

Thak you ElisaOriginally posted by trilly
hello
in mysql exist the operator clike that there is similar of like but there isn't key-sensitive. In oracle there is a similar operator?

And there is an operator similar of the function iif of access?

Thak you Elisa
Do you mean case-sensitive? No, in Oracle you would have to use UPPER or LOWER to force case, e.g.

WHERE UPPER(name) LIKE 'SMITH%'

What does IIF do? I'd guess it is probably something like Oracle's DECODE:

SELECT DECODE(status,1,'new',2,'old','unknown') FROM mytable;

This means:
Check value of mytable.status;
If it is 1 then return 'new'
If it is 2 then return 'old'
For any other values return 'unknown'

(Note: DECODE is not limited to 3 return values as in my example)

No comments:

Post a Comment