Advertisement
pipook

vista PKAUXILIAR_VIEW

Apr 19th, 2011
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE OR REPLACE VIEW PKAUXILIAR_VIEW  AS
  2.   SELECT punto_id, id_med, TO_DATE(TO_CHAR(fecha_sol,'dd/mm/yyyy')) AS fech,
  3.         TO_DATE(TO_CHAR(fecha_sol,'dd/mm/yyyy')) AS hora, SUM(cant_sol) AS cantsol, fue,
  4.         '1' AS n_fue, ope, lote_id, 'A' AS estado
  5.   FROM ripsmedicamentos
  6.   WHERE estado = 0
  7.   GROUP BY punto_id, id_med, lote_id, fue, ope, TO_CHAR(fecha_sol,'dd/mm/yyyy'), valor_tipo_entrega
  8.   ORDER BY TO_CHAR(fecha_sol,'dd/mm/yyyy');
  9.  
  10.  
  11. SELECT * FROM PKAUXILIAR_VIEW viewp WHERE viewp.fech = TO_DATE('17/03/2011')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement