Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from rol
- select * from abempleado
- select * from view_personal where apellido_paterno like 'PA%'
- select * from dt_gen_tabcod where tipo = 'PATH' and empresa='7'
- and codigo in ('FTPHOST','FTPUSER','FTPPASS')
- SELECT trim(codigo) FROM gen_tabcod WHERE empresa = "7" AND tipo = "GEN_MON" AND
- valor1 = 2 ORDER BY 1 desc
- select count(*) from pr_factura
- select * from cap_curso where descripcion like '%C++%'
- select * from con_trabajador where nombre like 'ZAN%'
- select* from cp_trabajador where nombre like 'ZAND%'
- select * from hr_penalidad_trab where ficha = 5570
- select * from sgc_firma_contrato where usuario_firma = 'ZSANCHEZ'
- select * from subgerencia
- select * from trabajadores where nombre like '%ando%'
- SELECT cod_unidad, descripcion, porctje_terc_inafi, porctje_terc_reta, porctje_terc_sec, porctje_cost_ing, fecha_cierre
- from afi_unidad WHERE empresa = '7000000'
- select * from clientes
- /*CREATE*/
- create table alumno_si(
- alumno_num serial primary key constraint numAlumno,
- alumno_codigo integer unique constraint codAlumno,
- alumno_descripion varchar(30)
- )
- create table curso(
- curso_num integer primary key constraint numCurso,
- curso_descripcion varchar(30),
- curso_creditos integer,
- )
- /*SELECT*/
- select * from alumno_si
- /*INSERT*/
- insert into alumno_si values(0, 111203, 'Zandor Sanchez')
- insert into alumno_si values(0, 111204, 'Stevan García')
- delete from alumno_si where alumno_num = 1
- select * from curso_si
- /*DROP*/
- drop table alumno_si
- /*UPDATE*/
- update alumno_si set alumno_descripion = 'Stevan Gutierrez' where alumno_num = 2;
- /*LOCK*/
- select * from alumno_si
- lock table alumno_si in exclusive mode
- select * from alumno_si
- unlock table alumno_si/*NO SE PUEDE BLOQUEAR Y DESBLOQUEAR
- DENTRO DE UNA TRANSACCIÓN*/
- insert into alumno_si values(0, 111205, 'Milagros Villanueva')
- /*BEGING WORK, COMMIT WORK, ROLLBACK WORK*/
- select * from empresa
- select * from servidor
- select * from sistema
- select * from recurso
- select * from perconvenio
- select * from perpra_adenda
- select convenio, cr, desde, hasta from perconvenio
- where empresa = '7' and hasta <= '2019-12-02' and cr like '266%'
- order by hasta desc
- select * from perpra_adenda where convenio in (10138, 10139)
- /*QUERY OFICIAL: DESPUÉS DE LA FECHA 01-06-2019 Cambiar el campo texto por el nuevo código*/
- update perpra_adenda set texto = replace(texto, '266', '904')where convenio in (
- select convenio from perconvenio
- where empresa = '7' and cr like '266%'
- ) and desde >= '2019-06-01' and tipo_adenda = 'CR'
- /*FIN DEL QUERY OFICIAL*/
- select * from perpra_adenda where convenio in (
- select convenio from perconvenio
- where empresa = '7' and cr like '266%'
- ) and desde >= '2019-06-01' and tipo_adenda = 'CR'
- select * from perpra_adenda where convenio = 10138
- select * from perpra_adenda where convenio = 10139
- /*QUERY OFICIAL ANTES DE LA FECHA*/
- insert into perpra_adenda
- select empresa, convenio, 5, 'CR', '2019-05-31', hasta, valor, cci, replace(texto, '266', '904'), 'XSIC', today
- from perpra_adenda where convenio in (
- select convenio from perconvenio
- where empresa = '7' and cr like '266%'
- ) and desde < '2019-06-01' and hasta >= '2019-06-01' and tipo_adenda = 'CR'
- update perpra_adenda set hasta = '2019-06-01' where convenio in (
- select convenio from perconvenio
- where empresa = '7' and cr like '266%'
- ) and desde < '2019-06-01' and hasta >= '2019-06-01' and tipo_adenda = 'CR'
- /*FIN DEL QUERY OFICIAL*/
- /*empresa, convenio, 5, 'CR', '2019-06-01', hasta, valor, cci, replace(texto, '266', '904'), 'XSIC', today */
- select empresa, convenio, 5, 'CR', '2019-06-01', hasta, valor, cci, replace(texto, '266', '904'), 'XSIC', today
- from perpra_adenda where convenio in (
- select convenio from perconvenio
- where empresa = '7' and cr like '266%'
- ) and desde < '2019-06-01' and tipo_adenda = 'CR'
- select * from perpra_adenda where convenio in (
- select convenio from perconvenio
- where empresa = '7' /*and hasta <= '2019-12-02'*/ and cr like '266%'
- ) and tipo_adenda = 'CR'
- select * from perpra_adenda where convenio in (
- select convenio from perconvenio
- where empresa = '7' /*and hasta <= '2019-12-02'*/ and cr like '266%'
- ) and tipo_adenda = 'CR' and desde >= '2019-06-01'
- create table prueba_queries(
- empresa char(3),
- convenio integer,
- tipo_adenda char(10),
- desde date,
- hasta date,
- texto varchar(25)
- )
- select * from prueba_queries
- insert into prueba_queries values ('7',10138,'CR', '2019-02-13','2019-07-13', '26610')
- insert into prueba_queries values ('7',10139,'CR', '2019-02-13','2019-07-12', '26610')
- insert into prueba_queries values ('7',10140,'CR', '2019-06-01','2019-07-12', '26610')
- insert into prueba_queries values ('7',10141,'CR', '2019-06-01','2019-07-12', '26610')
- /*CONDICIONALES EN INFORMIX*/
- select p.desde,
- case
- when desde < '2019-06-01' then 'P'
- else 'H'
- end
- from prueba_queries p
- update prueba_queries set texto = replace(texto, '266', '904')
- where desde >= '2019-06-01'
- select convenio, cr, desde, hasta from perconvenio
- where empresa = '7' and hasta <= '2019-06-01'
- select * from perpra_adenda
- where convenio = 10138
- select * from perpra_adenda where empresa = '7'
- where hasta < '2016/06/01'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement