Crear vista de NPPARTIDAS
De CidesaWiki
(Diferencias entre revisiones)
(New page: ---- create or replace view nppartidas as (select substr(a.codpre,b.longitud) as codpar,max(nompre) as nompar from cpdeftit a, (select sum(lonniv+1)+1 as longitud from cpniveles where cat...) |
|||
Línea 1: | Línea 1: | ||
- | + | <pre> | |
- | + | ||
create or replace view nppartidas as | create or replace view nppartidas as | ||
(select substr(a.codpre,b.longitud) as codpar,max(nompre) as nompar | (select substr(a.codpre,b.longitud) as codpar,max(nompre) as nompar | ||
Línea 8: | Línea 7: | ||
where length(rtrim(a.codpre))=c.longtot | where length(rtrim(a.codpre))=c.longtot | ||
group by substr(a.codpre,b.longitud)) | group by substr(a.codpre,b.longitud)) | ||
- | + | </pre> | |
- | + | ||
--[[Usuario:Pablosilva|Pablosilva]] 14:58 27 nov 2008 (VET) | --[[Usuario:Pablosilva|Pablosilva]] 14:58 27 nov 2008 (VET) |
Última versión de 19:00 27 nov 2008
create or replace view nppartidas as (select substr(a.codpre,b.longitud) as codpar,max(nompre) as nompar from cpdeftit a, (select sum(lonniv+1)+1 as longitud from cpniveles where catpar='C') b, (select sum(lonniv+1)-1 as longtot from cpniveles) c where length(rtrim(a.codpre))=c.longtot group by substr(a.codpre,b.longitud))
--Pablosilva 14:58 27 nov 2008 (VET)