CONSULTAS MYSQL - TIMO

Editar esta pagina


UPDATE t_equipo SET cod_ejecutor= '0000000006' WHERE marca ='AIMSAT';

RENAME TABLE nombre_actual TO nuevo_nombre;

EDIT t_articulo WHERE codart >'0000000000';

DELETE FROM t_equipo WHERE COD_EQUIPO IN (0000000313,0000000739);

funciona -- DELETE FROM t_equipo WHERE cod_equipo > '0000000312'


SELECT * FROM `bdequipo`.`v_estacion`;

SELECT * FROM V_estacion WHERE  nom_provincia LIKE  'ABANCAY%' ORDER BY nom_provincia ASC





-- ESTACIONES EN UNA PROVINCIA CON CONDICION POR RESPONSABLE DE MANTTO.E Y POR JECUTOR  

SELECT nom_resp_ul_mantto, nom_provincia,nom_distrito,direcc,etiquetaA,canal_frec,nom_tip_estacion,nom_ope_estac, nom_ejecutor FROM V_estacion WHERE  nom_provincia =  'ABANCAY' and nom_ejecutor = 'ING. LUIS SANTILLAN SANCHEZ' and nom_resp_ul_mantto = 'Ing. LUIS SANTILLAN SANCHEZ' and  f_ini_prox_mantto between '2024-11-14'and '2024-12-31' ORDER BY nom_distrito ASC;


-- UPDATE t_articulo SET cod_variable=1 WHERE codart >'0000000000';


EDIT t_articulo WHERE codart >'0000000000';

EDIT t_articulo WHERE codart >'0000000999';

EDIT t_articulo WHERE codart >'0000001999';

EDIT t_articulo WHERE codart >'0000002999';

EDIT t_articulo WHERE codart >'0000003999';


CONSULTAS MYSQL - TIMO AL 16-01-2025

CREATE view V_manob_emp as

SELECT t_manobra.cod_programa, t_manobra.etiqueta, t_manobra.cod_manobra, t_empleado.cod_empleado, t_empleado.nom_empleado

FROM 

t_manobra INNER JOIN t_empleado ON t_manobra.cod_empleado = t_empleado.cod_empleado 


UPDATE t_repuestot SET cod_Rep_herrT='0000000009' WHERE cod_repuestoT >'0000000000';

UPDATE t_material SET cod_proceso='0000000001' WHERE cod_material >'0000000000';

UPDATE t_material SET serie='SS' WHERE cod_material >'0000000000';

UPDATE t_material SET cod_usuarioW='0000000001' WHERE cod_material >'0000000000';

UPDATE t_material SET sTOCK='1' WHERE cod_material >'0000000000';


UPDATE t_equipo SET CANT=1 WHERE cod_equipo >'0000000000';

truncate t_actividad;

truncate t_actividad_otm;


truncate t_repuesto;

truncate t_repuesto_otm;


truncate t_manobra;

truncate t_manobra_otm;


truncate t_programa;

truncate t_otm;

------------------------


select*from t_actividad;

select*from t_actividad_otm;


select*from t_repuesto;

select*from t_repuesto_otm;


select*from t_manobra;

select*from t_manobra_otm;


select*from t_programa;

select*from t_otm;



--
-- Estructura de tabla para la tabla `t_Rep_herrT`
--

CREATE TABLE `t_Rep_herrT` (
  `cod_Rep_herrT` char(10) NOT NULL,
  `nom_Rep_herrT` varchar(45) default NULL,
  `cod_tip_eq` char(5) default NULL,
  `obs` varchar(45) default NULL,
  PRIMARY KEY  (`cod_Rep_herrT`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Volcar la base de datos para la tabla `t_Rep_herrT`
--


INSERT INTO `t_Rep_herrT` VALUES ('0000000001', 'HERR.ELEC.POR.', '3HEPO', 'HERRAMIENTAS ELÉCTRICAS PORTÁTILES ( taladros');
INSERT INTO `t_Rep_herrT` VALUES ('0000000002', 'HERR. DE MEDIC.', '4HMED', 'HERRAMIENTAS DE MEDICIÓN ( analizador de espe');
INSERT INTO `t_Rep_herrT` VALUES ('0000000003', 'HERR. ELEC.EST.', '5HEES', 'HERRAMIENTAS ELÉCTRICAS ESTACIONARIAS (compre');
INSERT INTO `t_Rep_herrT` VALUES ('0000000004', 'KID DE HERRAMI.', '8KDHT', 'KID DE HERRAMIENTAS(de destornilladores, alic');
INSERT INTO `t_Rep_herrT` VALUES ('0000000005', 'COMPON.TELEC.', '9CTEL', 'COMPONENTES DE EQ. TELECOMUNICACIONES');
INSERT INTO `t_Rep_herrT` VALUES ('0000000006', 'COMPON.INFOR.', '10CIN', 'COMPONENTES DE EQ. INFORMATICOS');
INSERT INTO `t_Rep_herrT` VALUES ('0000000007', 'HERR.DE MANO', '11HEM', 'HERRAMIENTAS DE MANO EN GENERAL SIN ETIQUETA');
INSERT INTO `t_Rep_herrT` VALUES ('0000000008', 'INSUM. MANTTO.', '12INS', 'INSUMOS DE MANTENIMIENTO');
INSERT INTO `t_Rep_herrT` VALUES ('0000000009', 'REPUESTOS', '13REP', 'REPUESTOS PARA REPARACION DE EQUIPOS');

-- --------------------------------------------------------



CREATE view V_ver_promgrama as
select
t_programa.cod_programa,
t_programa.cod_equipo,
t_otm.cod_otm,
t_otm.marca,
t_otm.modelo,
t_otm.serie,
t_otm.f_registro,
t_programa.cod_area,
t_programa.cod_distrito,
t_programa.situacion,
t_programa.etiqueta,
t_programa.nom_equip,
t_programa.t_mantto,
t_programa.cod_usuarioW
from
t_programa
inner join t_otm on t_programa.etiqueta=t_otm.etiqueta 






CREATE view V_repuestoT as
select
t_repuestoT.cod_repuestoT,
t_repuestoT.nom_repuestoT,
t_repuestoT.cod_Rep_herrT,
t_Rep_herrT.nom_Rep_herrT,
t_repuestoT.um,
t_repuestoT.marca,
t_repuestoT.modelo,
t_repuestoT.serie,
t_repuestoT.costo,
t_repuestoT.stock,
t_proceso.cod_proceso,
t_proceso.nom_proceso,
t_repuestoT.f_registro,
t_repuestoT.obs,
t_usuariow.cod_usuarioW,
t_empleado.nom_empleado
From t_repuestoT
inner join t_usuariow  on t_repuestoT.cod_usuarioW=t_usuariow.cod_usuarioW
inner join t_empleado on t_usuariow.cod_empleado=t_empleado.cod_empleado
inner join t_proceso on t_repuestoT.cod_proceso =t_proceso.cod_proceso
inner join t_Rep_herrT on t_repuestoT.cod_Rep_herrT =t_Rep_herrT.cod_Rep_herrT



--
-- Estructura de tabla para la tabla `t_repuestoT`
--

CREATE TABLE `t_repuestoT` (
  `cod_repuestoT` char(10) NOT NULL,
  `nom_repuestoT` varchar(60) default NULL,
  `tip_repuestoT` char(20) default NULL,
  `um` char(10) default NULL,
  `marca` varchar(40) default NULL,
  `modelo` varchar(40) default NULL,
  `serie` varchar(45) default NULL,
  `costo` decimal(8,2) default NULL,
  `cod_proceso` char(10) default NULL,
  `stock` int(11) default NULL,
  `f_registro` datetime default NULL,
  `obs` varchar(45) default NULL,
  `cod_usuarioW` char(10) default NULL,
  PRIMARY KEY  (`cod_repuestoT`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Volcar la base de datos para la tabla `t_repuestoT`
--

INSERT INTO `t_repuestoT` VALUES ('0000000001', 'Adaptador BNC', 'repuestoT', 'UND', 'ANPHENOL', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000002', 'Adaptador BNC - N Hembra', 'repuestoT', 'UND', 'ANPHENOL', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000003', 'Adaptador N Macho - BNC Hembra', 'repuestoT', 'UND', 'ANPHENOL', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000004', 'AISLADORES', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000005', 'ALAMBRE GALVANIZADO ', 'CONSUMIBLE', 'KG', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000006', 'ANCLA DE SUJECCION', 'repuestoT', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000007', 'ARANDELAS', 'CONSUMIBLE', 'UND', 'SM', 'TAMANO VARIOS', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000008', 'ARCO DE SIERRA 12 PULG', 'CONSUMIBLE', 'UND', 'TRUPER', 'ATT-12', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000009', 'Atenuador de 30 dB - 300W', 'repuestoT', 'UND', 'EAGLE TELECOM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000010', 'BROCA CEMENTO 8 mm', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000011', 'BROCA CEMENTO 6.5 mm', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000012', 'BROCA COBALTO', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000013', 'BROCA DE ACERO19mm 3/4', 'CONSUMIBLE', 'UND', 'HSS', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000014', 'BROCA DE CEMENTO 10 mm', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000015', 'BROCA DE CONCRETO10 mm', 'CONSUMIBLE', 'UND', 'ALPEN', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000016', 'BROCA DE CONCRETO6 mm', 'CONSUMIBLE', 'UND', 'ALPEN', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000017', 'BROCA DE CONCRETO8 mm', 'CONSUMIBLE', 'UND', 'ALPEN', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000018', 'BROCA FIERRO 3/8 PULG', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000019', 'BROCA MADERA', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000020', 'BROCA PASAMURO 5/8 PULG', 'CONSUMIBLE', 'UND', 'DEWALT', 'DW00720', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000021', 'CABLE  UTP', 'repuestoT', 'MTS', 'DIXON', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000022', 'CABLE DE AUDIO 2X18', 'repuestoT', 'MTS', 'BELDEN', '8451', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000023', 'CABLE DE RF', 'repuestoT', 'ROLLO', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000024', 'CABLE DIZON RG6', 'CONSUMIBLE', 'MTS', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000025', 'CABLE ELECTRICO AZUL12AWG', 'repuestoT', 'MTS', 'INDECO', 'TW-80', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000026', 'CABLE ELECTRICO AZUL4mm', 'repuestoT', 'MTS', 'INDECO', 'NH-80', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000027', 'CABLE ELECTRICO AZUL4mm', 'repuestoT', 'MTS', 'INDECO', 'NH-80', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000028', 'CABLE TELEFONICO DE 2 HILOS4mm', 'repuestoT', 'MTS', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000029', 'CABLE UNIFILAR 10mm2', 'CONSUMIBLE', 'ROLLO', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000030', 'CABLE UNIFILAR 6mm2', 'CONSUMIBLE', 'ROLLO', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000031', 'CABLE UTP CAT6', 'CONSUMIBLE', 'ROLLO', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000032', 'CANDADO TIPO CROSBY 1/8 PULG', 'repuestoT', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000033', 'CINTA AUTO VULCANIZANTE', 'CONSUMIBLE', 'UND', 'INDECO', 'NGA 19-10R', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000034', 'CINTAS AISLANTES', 'CONSUMIBLE', 'UND', '3M', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000035', 'CINTILLOS ', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000036', 'CONECTORES ', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000037', 'CONECTORES MC4', 'repuestoT', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000038', 'CONTRONLADOR HIBRIDO', 'repuestoT', 'UND', 'SM', 'WWS20-48', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000039', 'DISCO DE CORTE ACERO9x5/64x7/8 PULG', 'CONSUMIBLE', 'UND', 'NORTON', 'BNA-22', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000040', 'DISCO DE CORTE MADERA1"   25mm', 'CONSUMIBLE', 'UND', 'TRUPER', 'ST-1040E', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000041', 'DISCO DE CORTE PARA CONCRETO 9 PULG', 'CONSUMIBLE', 'UND', 'TOOTMAX', 'TL34773', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000042', 'DISCO DE DESBASTE PARA ACERO9X1/4X7/8 PULG', 'CONSUMIBLE', 'UND', 'NORTON', 'BDA 640', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000043', 'DISTRIBUIDOR DE POTENCIA', 'repuestoT', 'UND', 'TVSAT', '0611-26', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000044', 'DISTRIBUIDOR DE POTENCIA101.5 MHz (89.9MHz-105.5MHz)', 'repuestoT', 'UND', 'TVSAT', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000045', 'DISTRIBUIDOR DE POTENCIA103.9 MHz', 'repuestoT', 'UND', 'TVSAT', '0811-21', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000046', 'DISTRIBUIDOR DE POTENCIA88.5 MHz', 'repuestoT', 'UND', 'TVSAT', '0811-20', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000047', 'DISTRIBUIDOR DE POTENCIACANA 02', 'repuestoT', 'UND', 'TVSAT', '0611-21', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000048', 'DISTRIBUIDOR DE POTENCIACANA 04', 'repuestoT', 'UND', 'TVSAT', '0611-22', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000049', 'DISTRIBUIDOR DE POTENCIACANA 13', 'repuestoT', 'UND', 'TVSAT', '0611-26', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000050', 'ELECTRODO PUNTO AZUL', 'CONSUMIBLE', 'KG', 'PUNTO AZUL', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000051', 'FUENTE 12 V  2', 'repuestoT', 'UND', 'DAHUA', 'DH-PFM320D', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000052', 'HOJA DE SIERRA 24 DIENTES', 'CONSUMIBLE', 'UND', 'TRUPER', 'SBI-24', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000053', 'LLAVE TERMOMAGNETICA 20 AMPERIOS', 'repuestoT', 'UND', 'BTICINO', 'C20', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000054', 'LLAVE TERMOMAGNETICA 20 AMPERIOS', 'repuestoT', 'UND', 'STRONGER', 'C20', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000055', 'LNB', 'repuestoT', 'UND', 'VARIOS', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000056', 'LNB', 'repuestoT', 'UND', 'CAL AMP , CALIFORNIA', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000057', 'ORDENADORES DE CABLE', 'CONSUMIBLE', 'MTS', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000058', 'PERNOS', 'CONSUMIBLE', 'UND', 'SM', 'TAMANO VARIOS', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000059', 'PETALOS PARA ANTENA PARABOLICA', 'repuestoT', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000060', 'SOPORTE RACK', 'repuestoT', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000061', 'TARJETAS DE RADIO Y TV', 'repuestoT', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000062', 'TARJETAS FUSIBLE', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000063', 'TARUGO ', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000064', 'TEMPLADORES', 'CONSUMIBLE', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000065', 'TEMPORIZADOR TIMER', 'repuestoT', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000066', 'TEMPORIZADOR TIMER15 AMPERIOS', 'repuestoT', 'UND', 'ALION', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000067', 'TEMPORIZADOR TIMER15 AMPERIOS', 'repuestoT', 'UND', 'STRONGER', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000068', 'TERMINAL TIPO PIN', 'repuestoT', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000069', 'TONNER', 'CONSUMIBLE', 'UND', 'HP', 'VARIOS MODELOS', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000070', 'TONNER', 'CONSUMIBLE', 'UND', 'CONICAMINOLTA', 'VARIOS MODELOS', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000071', 'TONNER', 'CONSUMIBLE', 'UND', 'KYOSERA', 'VARIOS MODELOS', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000072', 'TRANSFORMADORES', 'repuestoT', 'UND', 'SM', 'SM', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000073', 'TRANSISTOR MOSFET', 'repuestoT', 'UND', 'SM', 'MRF6V2300NB', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');
INSERT INTO `t_repuestoT` VALUES ('0000000074', 'TUERCAS', 'CONSUMIBLE', 'UND', 'SM', 'TAMANO VARIOS', 'SS', 1.00, '0000000001', 1, '2025-01-19 00:00:00', NULL, '0000000001');

-- --------------------------------------------------------

*****************************************************************

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bdequipo`.`v_usuario` 

AS select 

`bdequipo`.`t_usuariow`.`cod_usuarioW` AS `cod_usuarioW`,

`bdequipo`.`t_usuariow`.`usuario` AS `usuario`,

`bdequipo`.`t_usuariow`.`clave` AS `clave`,

`bdequipo`.`t_usuariow`.`nom_usuario` AS `nom_usuario`,

`bdequipo`.`t_usuariow`.`cod_empleado` AS `cod_empleado`,

`bdequipo`.`t_usuariow`.`cargo` AS `cargo`,

`bdequipo`.`t_usuariow`.`dni` AS `dni`,

`bdequipo`.`t_empleado`.`cod_empleado` AS `cod_empleado`, 

`bdequipo`.`t_empleado`.`nom_empleado` AS `nom_empleado` 

from ((`bdequipo`.`t_usuariow`

 

join `bdequipo`.`t_usuariow` on((`bdequipo`.`t_usuariow`.`cod_usuarioW` = `bdequipo`.`t_usuariow`.`cod_usuarioW`))) 

join `bdequipo`.`t_empleado` on((`bdequipo`.`t_usuariow`.`cod_empleado` = `bdequipo`.`t_empleado`.`cod_empleado`)))

************************************************************************

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bdequipo`.`v_estacion` 

AS select `bdequipo`.`t_estacion`.`cod_estacion` 

AS `cod_estacion`,`bdequipo`.`t_estacion`.`cod_fitel` 

AS `cod_fitel`,`bdequipo`.`t_estacion`.`etiquetaA` 

AS `etiquetaA`,`bdequipo`.`t_estacion`.`canal_frec` 

AS `canal_frec`,`bdequipo`.`t_estacion`.`url_ubic` 

AS `url_ubic`,`bdequipo`.`t_estacion`.`nom_presid` 

AS `nom_presid`,`bdequipo`.`t_estacion`.`num_cel` 

AS `num_cel`,`bdequipo`.`t_distrito`.`cod_distrito` 

AS `cod_distrito`,`bdequipo`.`t_distrito`.`nom_distrito` 

AS `nom_distrito`,`bdequipo`.`t_provincia`.`cod_provincia` 

AS `cod_provincia`,`bdequipo`.`t_provincia`.`nom_provincia` 

AS `nom_provincia`,`bdequipo`.`t_departamento`.`cod_departamento` 

AS `cod_departamento`,`bdequipo`.`t_departamento`.`nom_departamento` 

AS `nom_departamento`,`bdequipo`.`t_estacion`.`direcc` 

AS `direcc`,`bdequipo`.`t_acceso`.`cod_acceso` 

AS `cod_acceso`,`bdequipo`.`t_acceso`.`nom_acceso` 

AS `nom_acceso`,`bdequipo`.`t_t_estacion`.`tip_estacion` 

AS `tip_estacion`,`bdequipo`.`t_t_estacion`.`nom_tip_estacion` 

AS `nom_tip_estacion`,`bdequipo`.`t_op_estacion`.`cod_ope_estac` 

AS `cod_ope_estac`,`bdequipo`.`t_op_estacion`.`nom_ope_estac` 

AS `nom_ope_estac`,`bdequipo`.`t_sist_energ`.`cod_sist_energ` 

AS `cod_sist_energ`,`bdequipo`.`t_sist_energ`.`nom_sist_energ` 

AS `nom_sist_energ`,`bdequipo`.`t_medidor`.`cod_medidor` 

AS `cod_medidor`,`bdequipo`.`t_medidor`.`nom_medidor` 

AS `nom_medidor`,`bdequipo`.`t_req_mantto`.`cod_req_mantto` 

AS `cod_req_mantto`,`bdequipo`.`t_req_mantto`.`nom_req_mantto` 

AS `nom_req_mantto`,`bdequipo`.`t_resp_mantto`.`cod_resp_ul_mantto` 

AS `cod_resp_ul_mantto`,`bdequipo`.`t_resp_mantto`.`nom_resp_ul_mantto` 

AS `nom_resp_ul_mantto`,`bdequipo`.`t_estacion`.`rep_r` 

AS `rep_r`,`bdequipo`.`t_estacion`.`ins_r` 

AS `ins_r`,`bdequipo`.`t_estacion`.`f_ini_prox_mantto` 

AS `f_ini_prox_mantto`,`bdequipo`.`t_estacion`.`f_fin_prox_mantto` 

AS `f_fin_prox_mantto`,`bdequipo`.`t_estacion`.`pend` 

AS `pend`,`bdequipo`.`t_estacion`.`dif_pr` 

AS `dif_pr`,`bdequipo`.`t_estacion`.`m_adq_repu` 

AS `m_adq_repu`,`bdequipo`.`t_cobertura`.`cod_cobertura` 

AS `cod_cobertura`,`bdequipo`.`t_cobertura`.`nom_cobertura` 

AS `nom_cobertura`,`bdequipo`.`t_ejecutor`.`cod_ejecutor` 

AS `cod_ejecutor`,`bdequipo`.`t_ejecutor`.`nom_ejecutor` 

AS `nom_ejecutor`,`bdequipo`.`t_estacion`.`obsv1` 

AS `obsv1`,`bdequipo`.`t_estacion`.`obsv2` 

AS `obsv2`,`bdequipo`.`t_estacion`.`h_fun_estac` 

AS `h_fun_estac`,`bdequipo`.`t_estacion`.`m_est_ub` 

AS `m_est_ub`,`bdequipo`.`t_estacion`.`obsv3` 

AS `obsv3`,`bdequipo`.`t_estacion`.`f_registro` 

AS `f_registro`,`bdequipo`.`t_usuariow`.`cod_usuarioW` 

AS `cod_usuarioW`,`bdequipo`.`t_empleado`.`nom_empleado` 

AS `nom_empleado` 

from ((((((((((((((`bdequipo`.`t_estacion` 

join `bdequipo`.`t_distrito` on((`bdequipo`.`t_estacion`.`cod_distrito` = `bdequipo`.`t_distrito`.`cod_distrito`))) 

join `bdequipo`.`t_provincia` on((`bdequipo`.`t_distrito`.`cod_provincia` = `bdequipo`.`t_provincia`.`cod_provincia`))) 

join `bdequipo`.`t_departamento` on((`bdequipo`.`t_provincia`.`cod_departamento` = `bdequipo`.`t_departamento`.`cod_departamento`))) 

join `bdequipo`.`t_acceso` on((convert(`bdequipo`.`t_estacion`.`cod_acceso` using utf8) = `bdequipo`.`t_acceso`.`cod_acceso`))) 

join `bdequipo`.`t_t_estacion` on((convert(`bdequipo`.`t_estacion`.`tip_estacion` using utf8) = `bdequipo`.`t_t_estacion`.`tip_estacion`))) 

join `bdequipo`.`t_op_estacion` on((`bdequipo`.`t_estacion`.`cod_ope_estac` = `bdequipo`.`t_op_estacion`.`cod_ope_estac`))) 

join `bdequipo`.`t_sist_energ` on((convert(`bdequipo`.`t_estacion`.`cod_sist_energ` using utf8) = `bdequipo`.`t_sist_energ`.`cod_sist_energ`))) 

join `bdequipo`.`t_medidor` on((convert(`bdequipo`.`t_estacion`.`cod_medidor` using utf8) = `bdequipo`.`t_medidor`.`cod_medidor`))) 

join `bdequipo`.`t_req_mantto` on((convert(`bdequipo`.`t_estacion`.`cod_req_mantto` using utf8) = `bdequipo`.`t_req_mantto`.`cod_req_mantto`))) 

join `bdequipo`.`t_resp_mantto` on((convert(`bdequipo`.`t_estacion`.`cod_resp_ul_mantto` using utf8) = `bdequipo`.`t_resp_mantto`.`cod_resp_ul_mantto`))) 

join `bdequipo`.`t_cobertura` on((`bdequipo`.`t_estacion`.`cod_cobertura` = `bdequipo`.`t_cobertura`.`cod_cobertura`))) 

join `bdequipo`.`t_ejecutor` on((`bdequipo`.`t_estacion`.`cod_ejecutor` = `bdequipo`.`t_ejecutor`.`cod_ejecutor`))) 

join `bdequipo`.`t_usuariow` on((`bdequipo`.`t_estacion`.`cod_usuarioW` = `bdequipo`.`t_usuariow`.`cod_usuarioW`))) 

join `bdequipo`.`t_empleado` on((`bdequipo`.`t_usuariow`.`cod_empleado` = `bdequipo`.`t_empleado`.`cod_empleado`)))

***********************************************************************************

SELECT t_distrito.cod_distrito, t_distrito.nom_distrito, t_provincia.cod_provincia, t_provincia.cod_departamento 

FROM t_provincia

INNER JOIN t_distrito ON t_provincia.cod_provincia = t_distrito.cod_provincia

where t_provincia.cod_departamento ='00000003';

*****************************************************************************
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bdequipo`.`v_equipo` 
AS select 
`bdequipo`.`t_equipo`.`cod_equipo` AS `cod_equipo`,
`bdequipo`.`t_equipo`.`etiqueta` AS `etiqueta`,
`bdequipo`.`t_equipo`.`etiquetaA` AS `etiquetaA`,
`bdequipo`.`t_equipo`.`nom_equip` AS `nom_equip`,
`bdequipo`.`t_equipo`.`marca` AS `marca`,
`bdequipo`.`t_equipo`.`modelo` AS `modelo`,
`bdequipo`.`t_equipo`.`serie` AS `serie`,
`bdequipo`.`t_distrito`.`cod_distrito` AS `cod_distrito`,
`bdequipo`.`t_distrito`.`nom_distrito` AS `nom_distrito`,
`bdequipo`.`t_provincia`.`cod_provincia` AS `cod_provincia`,
`bdequipo`.`t_provincia`.`nom_provincia` AS `nom_provincia`
,`bdequipo`.`t_departamento`.`cod_departamento` AS `cod_departamento`,
`bdequipo`.`t_departamento`.`nom_departamento` AS `nom_departamento`,
`bdequipo`.`t_equipo`.`direcc` AS `direcc`,
`bdequipo`.`t_area`.`cod_area` AS `cod_area`,
`bdequipo`.`t_area`.`nom_area` AS `nom_area`,
`bdequipo`.`t_tipoequipo`.`cod_tipoequipo` AS `cod_tipoequipo`,
`bdequipo`.`t_tipoequipo`.`nom_tipoequipo` AS `nom_tipoequipo`,
`bdequipo`.`t_estado`.`cod_estado` AS `cod_estado`,
`bdequipo`.`t_estado`.`nom_estado` AS `nom_estado`,
`bdequipo`.`t_criticidad`.`cod_criticidad` AS `cod_criticidad`,
`bdequipo`.`t_criticidad`.`nom_criticidad` AS `nom_criticidad`,
`bdequipo`.`t_riesgo`.`cod_riesgo` AS `cod_riesgo`,
`bdequipo`.`t_riesgo`.`nom_riesgo` AS `nom_riesgo`,
`bdequipo`.`t_proveedor`.`cod_proveedor` AS `cod_proveedor`,
`bdequipo`.`t_proveedor`.`nom_proveedor` AS `nom_proveedor`,
`bdequipo`.`t_proceso`.`cod_proceso` AS `cod_proceso`,
`bdequipo`.`t_proceso`.`nom_proceso` AS `nom_proceso`,
`bdequipo`.`t_equipo`.`a_fab` AS `a_fab`,
`bdequipo`.`t_equipo`.`a_adqui` AS `a_adqui`,
`bdequipo`.`t_equipo`.`cant` AS `cant`,
`bdequipo`.`t_equipo`.`f_recep` AS `f_recep`,
`bdequipo`.`t_equipo`.`f_marcha` AS `f_marcha`,
`bdequipo`.`t_equipo`.`g_provee` AS `g_provee`,
`bdequipo`.`t_equipo`.`g_fab` AS `g_fab`,
`bdequipo`.`t_equipo`.`m_adqui` AS `m_adqui`,
`bdequipo`.`t_cobertura`.`cod_cobertura` AS `cod_cobertura`,
`bdequipo`.`t_cobertura`.`nom_cobertura` AS `nom_cobertura`,
`bdequipo`.`t_ejecutor`.`cod_ejecutor` AS `cod_ejecutor`,
`bdequipo`.`t_ejecutor`.`nom_ejecutor` AS `nom_ejecutor`,
`bdequipo`.`t_equipo`.`med_segur` AS `med_segur`,
`bdequipo`.`t_equipo`.`ot_caract` AS `ot_caract`,
`bdequipo`.`t_equipo`.`h_utilz` AS `h_utilz`,
`bdequipo`.`t_equipo`.`m_eq_ub` AS `m_eq_ub`,
`bdequipo`.`t_equipo`.`obs` AS `obs`,
`bdequipo`.`t_equipo`.`f_registro` AS `f_registro`,
`bdequipo`.`t_usuariow`.`cod_usuarioW` AS `cod_usuarioW`,
`bdequipo`.`t_empleado`.`nom_empleado` AS `nom_empleado` 
from 
((((((((((((((`bdequipo`.`t_equipo` join `bdequipo`.`t_distrito` on((`bdequipo`.`t_equipo`.`cod_distrito` = `bdequipo`.`t_distrito`.`cod_distrito`))) join `bdequipo`.`t_provincia` on((`bdequipo`.`t_distrito`.`cod_provincia` = `bdequipo`.`t_provincia`.`cod_provincia`))) join `bdequipo`.`t_departamento` on((`bdequipo`.`t_provincia`.`cod_departamento` = `bdequipo`.`t_departamento`.`cod_departamento`))) join `bdequipo`.`t_area` on((`bdequipo`.`t_equipo`.`cod_area` = `bdequipo`.`t_area`.`cod_area`))) join `bdequipo`.`t_tipoequipo` on((`bdequipo`.`t_equipo`.`cod_tipoequipo` = `bdequipo`.`t_tipoequipo`.`cod_tipoequipo`))) join `bdequipo`.`t_estado` on((`bdequipo`.`t_equipo`.`cod_estado` = `bdequipo`.`t_estado`.`cod_estado`))) join `bdequipo`.`t_criticidad` on((`bdequipo`.`t_equipo`.`cod_criticidad` = `bdequipo`.`t_criticidad`.`cod_criticidad`))) join `bdequipo`.`t_riesgo` on((`bdequipo`.`t_equipo`.`cod_riesgo` = `bdequipo`.`t_riesgo`.`cod_riesgo`))) join `bdequipo`.`t_proveedor` on((`bdequipo`.`t_equipo`.`cod_proveedor` = `bdequipo`.`t_proveedor`.`cod_proveedor`))) join `bdequipo`.`t_proceso` on((`bdequipo`.`t_equipo`.`cod_proceso` = `bdequipo`.`t_proceso`.`cod_proceso`))) join `bdequipo`.`t_cobertura` on((`bdequipo`.`t_equipo`.`cod_cobertura` = `bdequipo`.`t_cobertura`.`cod_cobertura`))) join `bdequipo`.`t_ejecutor` on((`bdequipo`.`t_equipo`.`cod_ejecutor` = `bdequipo`.`t_ejecutor`.`cod_ejecutor`))) join `bdequipo`.`t_usuariow` on((`bdequipo`.`t_equipo`.`cod_usuarioW` = `bdequipo`.`t_usuariow`.`cod_usuarioW`))) join `bdequipo`.`t_empleado` on((`bdequipo`.`t_usuariow`.`cod_empleado` = `bdequipo`.`t_empleado`.`cod_empleado`)))
********************************************************************************************************************************************

HISTORICO

1.-

SELECT * FROM t_vend_pro 

inner join t_proveedor on t_vend_pro.cod_vendedor=t_proveedor.cod_vendedor 

where t_vend_pro.cod_vendedor='" & txtcodigoprov.Text & "' order by nomven"

2.-

SELECT * FROM t_doc_comercial where cod_documento > 0 and cod_documento < 3 order by descripcion

3.-

BORRAR DATOS DE LA TABLA T_PEDIDO

truncate t_pedido;

4.-

EDIT `bdequipo`.`t_equipo`;
5.-

CALL ver_categoria_usuario ('" & cUsuario & " ','" & Trim(cbocategoria.Text) & " '

6.-

select sum(importe_pago) as importepago from t_amorti_prove  where cod_compra='" & Trim(cbodeudas_pendientes.Text) & "'

7.-

UPDATE t_compra SET situacion='CANCELADO'  WHERE cod_compra= '" & cbodeudas_pendientes.Text & "'

8.-

insert into t_amorti_prove values( '" & Trim(lblcodamorti.Caption) & " ', '" & Trim(cbodeudas_pendientes.Text) & " ','" & impote_de_pago2 & " ','" & Trim(txtfecha.Text) & " ','" & Trim(txthora.Text) & " ','" & Trim(RsUSER.Fields("codusuario")) & " ','" & Trim(lblvendedor.Caption) & " ','" & lblcodope.Caption & "' )

9.-

SELECT * FROM t_opeegreso where cod_ope > 5 and cod_ope < 8 order by descripcion_egreso

10.-

select sum((precio_venta-p_cto_c)*cantidad)AS GANAHOY_F from V_utilidad WHERE cod_documento = '00000004' and fecha between  '" & txtfecha.Text & "' and '" & txtfech_fin & "' 

11.-

select  sum(stock*p_cto_c)AS INVERSION from t_articulo

12.-

lblnrocodigo.Caption = Format(Trim(Str(Val(RsEmp.Fields("CODIGO") + 1))), "00000000")

13.-

SELECT nomart,SUM(cantidad)Suma_Compras FROM V_utilidad_compra WHERE fecha between  '" & txtfecha.Text & "' and '" & TxtFecha2 & "'  GROUP BY nomart ORDER BY Suma_Compras ASC LIMIT 16

14.-

CSQL = "select fecha, hora, egreso_inicial, impor_pago, cod_entidad, descripcion, descripcion_egreso from v_egreso_caja_efectivo where  fecha between '" & txtfecha.Text & "' and '" & TxtFecha2 & "' and cod_ope='00000125'

15.-

select nomart,p_vta_c,p_cto_c,STOCK,NOM_SECCIONES,(p_vta_c - p_cto_c) as utilidad from v_articulo  order by utilidad desc

16.-

select nomart,p_vta_c,p_cto_c,STOCK,NOM_SECCIONES,(p_vta_c - p_cto_c) as utilidad from v_articulo where cod_secciones <> '00000016' order by utilidad desc

17.-

select sum(mto_tot)AS VENTA_MERCADERIAS_BOLETA_ST from t_venta_snt  where  fec_reg between '" & txtfecha.Text & "' and '" & TxtFecha2 & "' and tip_cmpte='03'

18.-

UPDATE t_articulo SET STOCK='1' WHERE Codart > '0'

19.-

SELECT codart,nomart, stock,stock_asig, p_cto_r, p_cto_c, detalle1, cod_clave1, nompro FROM v_articulo WHERE codart > '00003000%' ORDER BY codart DESC

20.-

EDIT  t_articulo  WHERE codart > '00001000%';

EDIT  t_articulo  WHERE codart < '00002000%';

21.-

UPDATE `sistbd`.`t_articulo` SET `STOCK`='0.0000' WHERE `codart`>'00000000';

-- UPDATE `sistbd`.`t_articulo` SET `p_cto_r`='0.0000' WHERE `codart`>'00000000';

-- UPDATE `sistbd`.`t_articulo` SET `p_cto_c`='0.0000' WHERE `codart`>'00000000';

-- UPDATE `sistbd`.`t_articulo` SET `p_vta_c`='0.0000' WHERE `codart`>'00000000';

22.-


select t_categ_art.fec_registro,t_categ_art.cod_categorias, t_categ_art.nom_categorias, t_categ_art.codusuario,t_empleado.nomemp from t_categ_art 
inner join t_usuario  on t_categ_art.codusuario=t_usuario.codusuario
inner join t_empleado on t_usuario.codemp=t_empleado.codemp
where t_categ_art.codusuario=usuario and t_categ_art.fec_registro between  fec_ini and fec_fin;

23.-
select codusuario, t_categoria.nom_categoria from t_usuario inner join t_categoria
 on t_categoria.cod_categoria=t_usuario.cod_categoria
where  usuario=clogin and nom_categoria=ccategoria;

24.-


select t_cliente_terceros.cod_cliente_ter,t_cliente_terceros.nom_cliente_ter,t_cliente_terceros.fec_registro,t_cliente.codcli,
t_cliente.nomcli,
t_usuario.usuario as usarionombre,t_empleado.nomemp as empnombre From t_cliente_terceros
inner join t_usuario  on t_cliente_terceros.codusuario=t_usuario.codusuario
inner join t_empleado on t_usuario.codemp=t_empleado.codemp
inner join t_cliente on t_cliente_terceros.codcli=t_cliente.codcli


where t_cliente_terceros.codusuario=usuario and t_cliente_terceros.fec_registro between  fec_ini and fec_fin;

25.-


select t_compra.codusuario,t_empleado.nomemp, t_detallecompra.cod_compra,t_detallecompra.peso_art,t_compra.fecha,t_egreso.hora,t_compra.codpro,t_proveedor.nompro,t_articulo.nomart, cantidad, t_compra.condicion,
precio_compra, t_detallecompra.total,t_doc_comercial.descripcion,t_compra.nro_documento,t_envase.descripcion_envase ,t_articulo.peso,t_transportes.nomtra from t_detallecompra
inner join t_articulo  on t_articulo.codart=t_detallecompra.codart
inner join t_compra  on t_compra.cod_compra=t_detallecompra.cod_compra
inner join t_proveedor  on t_proveedor.codpro=t_compra.codpro
inner join t_usuario  on t_usuario.codusuario=t_compra.codusuario
inner join t_empleado  on t_empleado.codemp=t_usuario.codemp
inner join t_doc_comercial on t_doc_comercial.cod_documento=t_compra.cod_documento
inner join t_egreso on t_egreso.cod_compra=t_compra.cod_compra
inner join t_envase on t_envase.cod_envase=t_articulo.cod_envase
inner join t_transportes on t_transportes.codtra=t_compra.codtra

where t_compra.cod_compra=clogin;

26.-


select t_compra_web.codusuario,t_compra_web.situacion,t_compra_web.condicion,t_empleado.nomemp, t_detallecompra_webb.cod_compra,
t_detallecompra_webb.peso_art,t_compra_web.fecha,t_ingreso_proyec_compra_web.hora,t_compra_web.codcli,t_cliente.nomcli,
t_articulo.nomart, cantidad, t_compra_web.condicion,precio_compra, t_detallecompra_webb.total,
t_doc_comercial.descripcion,t_compra_web.nro_documento,t_envase.descripcion_envase ,
t_articulo.peso,t_cliente_terceros.nom_cliente_ter from t_detallecompra_webb

inner join t_articulo  on t_articulo.codart=t_detallecompra_webb.codart
inner join t_compra_web  on t_compra_web.cod_compra=t_detallecompra_webb.cod_compra
inner join t_cliente  on t_cliente.codcli=t_compra_web.codcli
inner join t_usuario  on t_usuario.codusuario=t_compra_web.codusuario
inner join t_empleado  on t_empleado.codemp=t_usuario.codemp
inner join t_doc_comercial on t_doc_comercial.cod_documento=t_compra_web.cod_documento
inner join t_ingreso_proyec_compra_web on t_ingreso_proyec_compra_web.cod_compra=t_compra_web.cod_compra
inner join t_envase on t_envase.cod_envase=t_articulo.cod_envase
inner join t_cliente_terceros on t_cliente_terceros.cod_cliente_ter=t_compra_web.cod_cliente_ter


where t_compra_web.cod_compra=clogin and t_compra_web.condicion ='CONTADO';

27.-


select t_compra.codusuario,t_compra.condicion,t_compra.situacion,t_compra.deuda,t_empleado.nomemp, t_detallecompra.cod_compra,t_compra.fecha,t_compra.codpro,t_proveedor.nompro,t_articulo.nomart, cantidad, t_compra.condicion,
precio_compra, t_detallecompra.total,t_doc_comercial.descripcion,t_compra.nro_documento,t_envase.descripcion_envase,t_articulo.peso,
t_transportes.codtra,t_transportes.nomtra from t_detallecompra
inner join t_articulo  on t_articulo.codart=t_detallecompra.codart
inner join t_compra  on t_compra.cod_compra=t_detallecompra.cod_compra
inner join t_proveedor  on t_proveedor.codpro=t_compra.codpro
inner join t_usuario  on t_usuario.codusuario=t_compra.codusuario
inner join t_empleado  on t_empleado.codemp=t_usuario.codemp
inner join t_doc_comercial on t_doc_comercial.cod_documento=t_compra.cod_documento
inner join t_envase on t_envase.cod_envase=t_articulo.cod_envase
inner join t_transportes on t_transportes.codtra=t_compra.codtra

where t_compra.cod_compra=clogin;

28.-





No hay comentarios:

Publicar un comentario

Entrada destacada

CASAS, TERRENOS EN VENTA EN ABANCAY - APURIMAC

Entradas populares