ORACLE数据库中最快的是什么?
在选择说明中要求一项功能,以重新计算每行的单一价值
SELECT field1, field2, F_GET_LIBELLE_STATUT( field2 ) FROM table1 WHERE ...
具有简单功能:
create or replace
FUNCTION "F_GET_LIBELLE_STATUT" (v_statut NUMBER) RETURN VARCHAR2 IS
tmpVar VARCHAR2(40);
BEGIN
select libelle into tmpVar from t_statut_ope where id_statut = v_statut;
RETURN tmpVar;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN ;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END f_get_libelle_statut;
还是加入其中?
Select a.field1, a.field2, b.libelle
FROM table1 a LEFT JOIN t_statut_ope b ON b.id_statut = a.field2
WHERE ...
如果我在选择和条款条件中讲到许多职能(或更多),那是同样答案吗?
感谢您的回答。