Fungsi PostgreSQL yang sama dengan NVL milik Oracle
Bagi anda yang sering berkutat dengan Oracle, pasti sering membutuhkan fungsi NVL dalam operasi query. NVL sangat berguna untuk operasi view data. Sayangnya fungsi ini tidak ada di PostgreSQL (atau saya yang tidak tahu?). Setelah berpusing-pusing ria dengan manual PostgreSQL, akhirnya saya menemukan satu fungsi yang memiliki perilaku sama. Yaitu fungsi COALESCE.
Deskripsi dari manual adalah sebagai berikut :
The COALESCE function returns the first of its arguments that is not null. Null is returned only if all arguments are null. It is often used to substitute a default value for null values when data is retrieved for display, for example:
SELECT COALESCE(description, short_description, '(none)') ...Like a CASE expression, COALESCE will not evaluate arguments that are not needed to determine the result; that is, arguments to the right of the first non-null argument are not evaluated. This SQL-standard function provides capabilities similar to NVL and IFNULL, which are used in some other database systems.
sumpeh kagak ngerti SQL, NVL, …. apa itu ya ??? kalo functor ngerti gak ??? ;D. hahaha harus belajar nih keknya, duit IT ada di Database sih :p
Comment by L_O_J — July 18, 2006 @ 5:31 am
#1 : kekekekekeke, tapi gue juga ga’ ngerti algoritma game
. Jadi 1 sama deh hehehe
Comment by Arief Bayu Purwanto — July 18, 2006 @ 6:18 am