Crear vista de NPCATPRE
De CidesaWiki
(Diferencias entre revisiones)
(New page: create or replace view npcatpre as (select rpad(substr(a.codpre,1,b.longitud),32,' ') as codcat,max(upper(trim(nompre))) as nomcat from cpdeftit a, (select sum(lonniv+1)-1 as longitud from...) |
|||
Línea 1: | Línea 1: | ||
+ | |||
+ | ---- | ||
create or replace view npcatpre as | create or replace view npcatpre as | ||
(select rpad(substr(a.codpre,1,b.longitud),32,' ') as codcat,max(upper(trim(nompre))) as nomcat | (select rpad(substr(a.codpre,1,b.longitud),32,' ') as codcat,max(upper(trim(nompre))) as nomcat | ||
Línea 4: | Línea 6: | ||
where length(rtrim(a.codpre))=b.longitud | where length(rtrim(a.codpre))=b.longitud | ||
group by substr(a.codpre,1,b.longitud)) | group by substr(a.codpre,1,b.longitud)) | ||
+ | |||
+ | ---- | ||
+ | |||
+ | --[[Usuario:Pablosilva|Pablosilva]] 14:51 27 nov 2008 (VET) |
Revisión de 18:51 27 nov 2008
create or replace view npcatpre as (select rpad(substr(a.codpre,1,b.longitud),32,' ') as codcat,max(upper(trim(nompre))) as nomcat from cpdeftit a, (select sum(lonniv+1)-1 as longitud from cpniveles where catpar='C') b where length(rtrim(a.codpre))=b.longitud group by substr(a.codpre,1,b.longitud))
--Pablosilva 14:51 27 nov 2008 (VET)