Minientrada

ORACLE Medir Tiempos

SET SERVEROUTPUT ON
DECLARE
v_d1 TIMESTAMP ;
v_d2 TIMESTAMP ;
v_n INTERVAL DAY TO SECOND ;
v_variable NUMBER;
BEGIN
v_d1 := SYSTIMESTAMP ;
SELECT count(*) into v_variable from TABLE;
v_d2 := SYSTIMESTAMP ;
v_n := v_d2-v_d1 ;
DBMS_OUTPUT.PUT_LINE( 'Tiempo transcurrido : ' ||EXTRACT( SECOND FROM v_n )|| ' segundos' ) ;
END;

Anuncios

Select TOP equivalencias en otros lenguajes

SQL Server / MS Access

SELECT TOP number|percent column_name(s)
FROM table_name;

SQL SELECT TOP equivalencia en MySQL and Oracle

MySQL

SELECT column_name(s)
FROM table_name
LIMIT number;

Ejemplo

SELECT *
FROM Persons
LIMIT 5;

Oracle

SELECT column_name(s)
FROM table_name
WHERE ROWNUM <= number;

Ejemplo

SELECT *
FROM Persons
WHERE ROWNUM <=5;