Blast06

FUNCIONES ORACLE

Apr 1st, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. Upper->
  2. lower->
  3. Intpcap->
  4. Substr->
  5. INSTR->select instr(email,'@') from estudiante; buscar un caracter en especifico y si existe devuelve su posicion, sino, cero.
  6. REPLACE-> select replace(nombre,'ñ','n') reemplaza informacion que no se quiere mostrar, por ejemplo los de la tarjeta de credito
  7. DECODE->Un if para cuando se cumple tal cosa, meter mas informacion. Ex select decode(estado_civil,'s',soltero...etc)
  8. RTRIM-> BORRAR ESPACIOS EN BLANCO select rtrim(nombre,'s');
  9. LTRIM->?
  10. RAID->
  11. LPAD->select lpad(codigo,10,'0') pone 10 ceros delante de una cantidad, o en este caso codigo.
  12. dual->para hacer selects de pruebas, sin usar tablas-> SELECT RPAD('CADENA',10,'*') AS PRUEBA
  13. FROM DUAL;
  14. NVL-> Para cuando son nulos, devolver un dato(numero o letra) deseado. select (null(precio,0)* null(cantidad,1))
  15. where nvl(estado,'a')='a'
  16. SYSDATE-> Da la fecha del dia.
  17. TO_DATE('01/04/2016','DD/MM/YYYY')
  18.  
  19.  
  20. SELECT LOWER(NOMBRE)||' '||LOWER(APELLIDO)
  21. FROM ESTUDIANTES
  22. WHERE SUBSTR(CEDULA,1,3) IN('047','402')
  23.  
  24. DEVJOKER.COM(FUNCIONESDE PL-SQL)
  25.  
  26.  
  27. SELECT ID_CAMIONES,ID_CAMIONERO,C.NOMBRE CI.NOMBRE,CI.ID_POSTAL_C,P.ID_PAQUETE
  28. FROM CAMIONERO C, CAMIONES CA, CIUDAD CI, PAQUETE P, TRANSP_PAQUETE TP, TRANSPORTE T
  29. WHERE C.ID_CAMIONERO=CA.ID_CAMIONERO AND T.ID_TRANSPORTE=TP.ID_TRANSPORTE AND TP.ID_PAQUETE=P.ID_PAQUETE AND P.ID_POSTAL_C=CI.ID_POSTAL_C;
Add Comment
Please, Sign In to add comment