Powered By Blogger

Sunday 29 May 2016

Difference Between CASE and DECODE




CASE
DECODE
1.CASE expression complies with ANSI SQL
1. DECODE is specific to Database vendors (like Oracle, SQL Server)
2. Case can compare discrete as well as Range value
2. DECODE compare discrete values not Range
3. CASE can work with logical operators, predicates and searchable subqueries.
3. DECODE can work with only scaler values
4. CASE is a statement.
4. DECODE is a function.
5. CASE expects datatype consistency.
5. DECODE does not expects datatype consistency.












No comments: