I need a query to get all the values of taxes from the year 2008
I have 2 tables in oracle 10.2.0.1
sm_coaster_bills(
id_coaster_bills number, (pk)
id_coaster number, (fk from table sm_coasters)
period varchar2(6), (JANMAR or APRJUN or JULSEP or OCTDEC (months of trimenster))
year varchar2(4), (year when the bill was generated)
value (the value of the debt)
expiration date, (date of expiration of the payment)
paid varchar2(1) (Y or N paid or not)
and
re_interests(
id_interests number, (pk)
value number, (the interest in a specific year)
type varchar2(3), 'specify if the interest is anual or trimestral'
period number, (1 or 2 or 3 or 4 depending of the trimester )
year date, (day of the current interest ))
the expirtation date is the last day when yyou can pay after thar the bill start to charge interests from the first month of the trimester
The value of interests change year by year.
I need a query or a function maybe a procedure that returns the total value of the bill changing the interest charged year after year.
i mean this is a record of table sm_coaster bills
(1, 7, 'OCTDEC', '2011', 321.21, 15/10/2011, N) this is a coaster bill not paid since october 2011 acquired in the period October-December
and this are records from re_interests
1, 12.3, 1, TRI, 2009
2, 12.3, 2, TRI, 2009
3, 12.3, 3, TRI, 2009
4, 12.3, 4, TRI, 2009
5, 23.0 0, ANU, 2009
6, 13.5, 1, TRI, 2010
7, 13.5, 2, TRI, 2010
8, 13.5, 3, TRI, 2010
9, 13.5, 4, TRI, 2010
10, 24, 0, ANU, 2010
11, 14.5, 1,TRI, 2011
12, 14.5, 2, TRI, 2011
13, 14.5, 3, TRI, 2011
14, 14.5, 4, TRI, 2011
15, 25, 0, ANU, 2011
16, 15.5, 1, TRI, 2012
16, 15.5, 2, TRI, 2012
16, 15.5, 3, TRI, 2012
for exaple if the license was bought on period JANMAR(january - march) year 2012 then the result should be
320 multiplied for the interest of that trimester again multiplied for the interest of the next trimester APRJUN and the interest of the actual trimester
value janmar aprjun julsep
320* 1.135 * 1.135 * 1.135
but if the bill was made on any trimester of any other year in the past then
$320 should be multiplied for the anual interest of those years
for exaple if the license was bought on period APRJUN(april - june) year 2009 then the result should be
value 2009 2010 2011 janmar aprjun julsep
320 * 1.23 * 1.24 * 1.25 * 1.135 * 1.135 * 1.135
I want a procedure or a function that takes all values selecting all those interests year by year or trimestral whatever the case
Edited by: mbarquet on 08/08/2012 08:04 PM
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (8, 30, 1, 11.97, 11.97, 5.99, '2007', 'JULSEP', to_date('30-09-2007 23:59:59', 'dd-mm-yyyy hh24:mi:ss'), 1, 35.91, 0, 0, 0, 0, 1, 35.91, 0, 0, 0, 0, 0, 0, 71.82, null, 'A', to_date('27-08-2007 08:58:28', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('04-09-2007 12:33:17', 'dd-mm-yyyy hh24:mi:ss'), 'JDELGADO');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (2323, 30, 1, 14.04, 14.04, 7.03, '2010', 'ABRJUN', to_date('08-05-2010 14:54:40', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 0, 0, 84.24, null, 'A', to_date('08-04-2010 14:51:25', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('03-05-2010 15:45:30', 'dd-mm-yyyy hh24:mi:ss'), 'LTAPIA');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (2467, 394, 0, 14.04, 14.04, 7.03, '2010', 'ABRJUN', to_date('08-05-2010 14:55:19', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 84.24, null, 'A', to_date('08-04-2010 14:52:04', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (2541, 30, 1, 14.04, 14.04, 7.03, '2010', 'JULSEP', to_date('15-08-2010 10:06:42', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 0, 0, 84.24, null, 'A', to_date('16-07-2010 10:01:41', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('27-07-2010 11:05:15', 'dd-mm-yyyy hh24:mi:ss'), 'LTAPIA');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (2102, 30, 1, 14.04, 14.04, 7.03, '2010', 'ENEMAR', to_date('18-02-2010 10:33:28', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 0, 0, 84.24, null, 'A', to_date('19-01-2010 10:38:53', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('01-02-2010 09:34:43', 'dd-mm-yyyy hh24:mi:ss'), 'LAGARCIA');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (2262, 394, 0, 14.04, 14.04, 7.03, '2010', 'ENEMAR', to_date('18-02-2010 10:34:09', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 84.24, null, 'A', to_date('19-01-2010 10:39:33', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (2666, 394, 0, 14.04, 14.04, 7.03, '2010', 'JULSEP', to_date('15-08-2010 10:07:20', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 84.24, null, 'A', to_date('16-07-2010 10:02:20', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (2726, 30, 1, 14.04, 14.04, 7.03, '2010', 'OCTDIC', to_date('13-11-2010 09:46:45', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 0, 0, 84.24, null, 'A', to_date('14-10-2010 09:40:04', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('04-11-2010 10:28:29', 'dd-mm-yyyy hh24:mi:ss'), 'MSANTOS');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (2865, 394, 0, 14.04, 14.04, 7.03, '2010', 'OCTDIC', to_date('13-11-2010 09:47:25', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 84.24, null, 'A', to_date('14-10-2010 09:40:44', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (2943, 30, 1, 14.51, 14.51, 7.26, '2011', 'ENEMAR', to_date('18-02-2011 09:35:09', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 0, 0, 87.06, null, 'A', to_date('19-01-2011 09:23:00', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('31-01-2011 15:35:02', 'dd-mm-yyyy hh24:mi:ss'), 'MSANTOS');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3322, 30, 1, 14.51, 14.51, 7.26, '2011', 'JULSEP', to_date('13-08-2011 08:36:38', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 0, 0, 87.06, null, 'A', to_date('14-07-2011 08:31:12', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('21-07-2011 12:02:17', 'dd-mm-yyyy hh24:mi:ss'), 'ASAGASTI');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3431, 394, 0, 14.51, 14.51, 7.26, '2011', 'JULSEP', to_date('13-08-2011 08:37:16', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 87.06, null, 'A', to_date('14-07-2011 08:31:49', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3563, 30, 2, 14.51, 14.51, 7.26, '2011', 'OCTDIC', to_date('02-11-2011 08:31:37', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 0, 0, 87.06, null, 'A', to_date('03-10-2011 08:25:50', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('27-10-2011 11:04:39', 'dd-mm-yyyy hh24:mi:ss'), 'ASAGASTI');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3058, 394, 0, 14.51, 14.51, 7.26, '2011', 'ENEMAR', to_date('18-02-2011 09:35:44', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 87.06, null, 'A', to_date('19-01-2011 09:23:35', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3122, 30, 1, 14.51, 14.51, 7.26, '2011', 'ABRJUN', to_date('21-05-2011 10:31:57', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 0, 0, 87.06, null, 'A', to_date('21-04-2011 10:22:14', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('27-04-2011 12:19:40', 'dd-mm-yyyy hh24:mi:ss'), 'LTAPIA');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3230, 394, 0, 14.51, 14.51, 7.26, '2011', 'ABRJUN', to_date('21-05-2011 10:32:40', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 87.06, null, 'A', to_date('21-04-2011 10:22:56', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3743, 30, 1, 15.3, 15.3, 7.65, '2012', 'ENEMAR', to_date('17-02-2012 10:43:42', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 0, 0, 91.8, null, 'A', to_date('18-01-2012 10:30:30', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('27-02-2012 16:35:35', 'dd-mm-yyyy hh24:mi:ss'), 'MGUERRA');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3853, 394, 0, 15.3, 15.3, 7.65, '2012', 'ENEMAR', to_date('17-02-2012 10:44:15', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 91.8, null, 'A', to_date('18-01-2012 10:31:02', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3942, 30, 1, 15.3, 15.3, 7.65, '2012', 'ABRJUN', to_date('16-05-2012 16:38:19', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 0, 0, 91.8, null, 'A', to_date('16-04-2012 16:31:43', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('16-05-2012 16:06:51', 'dd-mm-yyyy hh24:mi:ss'), 'ASAGASTI');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (4180, 30, 1, 15.3, 15.3, 7.65, '2012', 'JULSEP', to_date('09-08-2012 18:10:47', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 0, 0, 91.8, null, 'A', to_date('10-07-2012 17:55:09', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('16-07-2012 15:30:30', 'dd-mm-yyyy hh24:mi:ss'), 'NAGUIRRE');
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (4065, 394, 0, 15.3, 15.3, 7.65, '2012', 'ABRJUN', to_date('16-05-2012 16:38:53', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 91.8, null, 'A', to_date('16-04-2012 16:32:17', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (3673, 394, 0, 14.51, 14.51, 7.26, '2011', 'OCTDIC', to_date('02-11-2011 08:32:16', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 87.06, null, 'A', to_date('03-10-2011 08:26:29', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
values (4284, 394, 0, 15.3, 15.3, 7.65, '2012', 'JULSEP', to_date('09-08-2012 18:11:21', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 91.8, null, 'A', to_date('10-07-2012 17:55:43', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
now for expample the registry from sm_costeras _planillas with id 4284 has a bill on julsep of 2012 that does not need to be charge
the registry 3673 bill is on octdic of 2011 so as it is from the las year it charges the anual income for this year %12.78 plus the income of this year's trimesters
if the registry is from 2009 the charge will be the incom of year 2009 plus 2010 plus2011 and the income of this year's trimesters
the incomes charged on the value of the bill is complete y the expiration date is done then the bill of the trimester is complete also y the bill was on 30 dec of any year the bill is charge with the full year income even if its just for 2 days
Similar Messages
-
Query to get all the worksheets for a particular work book
Hi All,
I want to get all the associated worksheets for a particular workbook. What query will fetch mne those details. Also, where can find the EUL5 tables documentation
Regards
ThomasHi Tamir,
Thanks so far. I am yet to make the crucial breakthrough as far my application goes. Are you talking about the EUL5_QPP_STATS table? I tried retrieving worksheets even from that table also with the following query
SELECT DISTINCT Eul5QppStats.QS_DOC_NAME,Eul5QppStats.QS_DOC_DETAILS
FROM EUL5_QPP_STATS Eul5QppStats,EUL5_DOCUMENTS Eul5Documents
WHERE Eul5QppStats.QS_DOC_NAME = Eul5Documents.DOC_NAME
However, the worksheet data retrieved by Discoverer Oracle's product is not matching my dataset for every workbook. Please suggest.
Reg
Thomas -
Mysql query not getting all the results, works fine in php
Hi All,
I have a slightly big query which works fine in php getting 400 results but in java I get only 14 results when I traverse through resultset. Here is the query
(select t1.to_uri as inv_to_uri, t1.sip_to as inv_sip_to, t1.sip_callid as inv_callid, t1.time as inv_time, t1.fromtag as inv_fromtag, t1.sip_status as inv_status, t2.to_uri as bye_to_uri, t2.sip_to as bye_sip_to, t2.sip_callid as bye_callid, t2.time as bye_time, t2.fromtag as bye_fromtag, t2.totag as bye_totag, t2.from_uri as bye_from_uri, t2.sip_from as bye_sip_from, sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length, ifnull(t1.time, t2.time) as ttime , 'outgoing' as call_type from acc t1 left outer join acc t2 on t1.sip_callid=t2.sip_callid and ((t1.totag=t2.totag and t1.fromtag=t2.fromtag) or (t1.totag=t2.fromtag and t1.fromtag=t2.totag)) and t2.sip_method='BYE' where t1.sip_method='INVITE' and (t1.username='manoj' and t1.domain='mantragroup.com') and t1.caller_deleted != '1' ) union (select t1.to_uri as inv_to_uri, t1.sip_to as inv_sip_to, t1.sip_callid as inv_callid, t1.time as inv_time, t1.fromtag as inv_fromtag, t1.sip_status as inv_status, t2.to_uri as bye_to_uri, t2.sip_to as bye_sip_to, t2.sip_callid as bye_callid, t2.time as bye_time, t2.fromtag as bye_fromtag, t2.totag as bye_totag, t2.from_uri as bye_from_uri, t2.sip_from as bye_sip_from, sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length, ifnull(t1.time, t2.time) as ttime , 'outgoing' as call_type from acc t1 right outer join acc t2 on t1.sip_callid=t2.sip_callid and ((t1.totag=t2.totag and t1.fromtag=t2.fromtag) or (t1.totag=t2.fromtag and t1.fromtag=t2.totag)) and t1.sip_method='INVITE' where t2.sip_method='BYE' and isnull(t1.username) and (t2.username='manoj' and t2.domain='mantragroup.com') and t2.callee_deleted != '1' ) order by ttime DESC limit 100,50
Also this queru works fine on mysql console getting all 400 results. Please tell me what might be going wrong in Java.
Thanks for your help and time,
Manoj.How do you know you're doing the same query in PHP, MySQL, and the console?
What's the code that's executing this?
There's nothing intrinsically wrong with the query, although it's a bit messy - surely it could be simplified from that?
Please format queries before posting in future. Also, did you really mean to let us know your company name and the name of a user? Seems a bit indiscrete.
select
t1.to_uri as inv_to_uri,
t1.sip_to as inv_sip_to,
t1.sip_callid as inv_callid,
t1.time as inv_time,
t1.fromtag as inv_fromtag,
t1.sip_status as inv_status,
t2.to_uri as bye_to_uri,
t2.sip_to as bye_sip_to,
t2.sip_callid as bye_callid,
t2.time as bye_time,
t2.fromtag as bye_fromtag,
t2.totag as bye_totag,
t2.from_uri as bye_from_uri,
t2.sip_from as bye_sip_from,
sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length,
ifnull(t1.time, t2.time) as ttime ,
'outgoing' as call_type
from
acc t1
left outer join
acc t2
on
t1.sip_callid=t2.sip_callid
and
( (t1.totag=t2.totag and t1.fromtag=t2.fromtag)
or (t1.totag=t2.fromtag and t1.fromtag=t2.totag))
and
t2.sip_method='BYE'
where
t1.sip_method='INVITE'
and
(t1.username='manoj' and t1.domain='mantragroup.com') and t1.caller_deleted != '1'
union
select
t1.to_uri as inv_to_uri,
t1.sip_to as inv_sip_to,
t1.sip_callid as inv_callid,
t1.time as inv_time,
t1.fromtag as inv_fromtag,
t1.sip_status as inv_status,
t2.to_uri as bye_to_uri,
t2.sip_to as bye_sip_to,
t2.sip_callid as bye_callid,
t2.time as bye_time,
t2.fromtag as bye_fromtag,
t2.totag as bye_totag,
t2.from_uri as bye_from_uri,
t2.sip_from as bye_sip_from,
sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length,
ifnull(t1.time, t2.time) as ttime ,
'outgoing' as call_type
from
acc t1
right outer join
acc t2
on
t1.sip_callid=t2.sip_callid
and
( (t1.totag=t2.totag and t1.fromtag=t2.fromtag)
or (t1.totag=t2.fromtag and t1.fromtag=t2.totag))
and
t1.sip_method='INVITE'
where
t2.sip_method='BYE'
and
isnull(t1.username)
and
(t2.username='manoj' and t2.domain='mantragroup.com')
and
t2.callee_deleted != '1'
order by ttime DESC limit 100,50 -
Looking for a SQL query to get all the possible Alert Messages from the Rules in a Management Pack
For reporting, I'm looking to get a SQL query of all the possible Alert Messages for Rules configured in a Management Pack (not necessarily the ones that have thrown alerts). I can do this for Monitors, but not for Rules.
The configured alert messages for the Management Pack Monitors
go like this: ManagementPack > MonitorView> RuleModule > RuleModule.Alert Message > Localized Text
The configured alert messages for the Management Pack Rules
should go something like this, but there is a missing link: ManagementPack > RuleView > RuleModule > ? Missing Link ? > Localized Text
The Rules are tied to the Module, but I don't see a connection from the RulesModule to the Alert Message that I see in the LocalizedText. The Rule names do not always equal the Alert name.
Can someone provide the missing link?Hi,
please try below powershell code to find the corresponding management pack for specific alert:
$Alert = get-scomalert | where {$_.Name -like 'Agent Proxy Not Enabled*'} | select -first 1
If ($alert.IsMonitorAlert -eq "True") {
write-host "Ths is a monitor-generated alert"
get-scommonitor -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
else
write-host "This is a rule-generated alert"
get-scomrule -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
In addition, please also refer to the below link:
http://blogs.technet.com/b/mazenahmed/archive/2011/12/02/using-powershell-to-map-opsmgr-active-alert-to-its-corresponding-rule-monitor-and-management-pack-name.aspx
Regards,
Yan Li
Regards, Yan Li -
Query to get all the data in specific range
Dear All,
I have a table and having 50 records. So i want to fetch the records from specified range.
Ex:
1. I want to fetch the records from first 1 to 10 records ( range i will pass) or i want to fetch from 20 to 30 records.
Please help regarding thatYKING wrote:
Dear Thanks for replying,
i want to display the first 10 records/display the between 20 to 30 range records (from 20 th records to 30 th records). I m using below query one is working but another is not working. pelase advise what wrong with one which is not working
Not working :-
select rownum , b.*
from
(select rownum, a.* from table_name a
order by colum1) b
where rownum between &a and &b
working :-
select *
from (select rownum rn, a.*
from table_name a
order by vesl_master_num)
where rn between &s and &q;What's wrong with the one that is not working ... ok...
You are using "rownum" which is a psuedo column assigned to the returned rows. So if row 1 is not returned then there will never be a rows 2, 3, 4 etc. so you can't say you want e.g. rownum between 10 and 20 because rows 1 to 9 haven't been returned, so there's no such things as a row 10,11,12 etc.
In the query that's working you've kind of captured the rownum for all the rows and then you can restrict it. However, the ordering of the data still isn't right in that last example, because the ordering takes place after the rownum is assigned.
So what you really want is...
select *
from (select rownum rn, a.*
from table_name a
order by vesl_master_num)
where rn between &s and &q;which applies the ordering first, then applies the row numbers outside that, and then restricts to certain row numbers outside that. -
Using LDAP query to get all the domains from all the forests in my company
Foreword:
I'm using two domain controller (dc1 and dc2). I'm using a domain registered to the root domain dc1 and simply request all of the domains in its forest by preforming search in the CN=Partitions,CN=Configuration,DC=dc1,dc=local.
I can also get the root domain dns of my trusted forest (dc2) from the default naming context under "CN=System" by looking for an object of type "trustedDomain".
The problem:
The problem is that I can't see/find the other domains (childs) of the root domain dc2 from the active directory information found in dc1. In order to get these domains I currently bind to this domain controller (dc2) and preform the same search as I did in
the domain controller dc1 (CN=Partitions,CN=Configuration,DC=dc2,dc=local) to get all its childs.
Must I use this binding to each root domain in other forest in order to request all of its domains? Is there a better way to do it? I read about referrals which seems like a solution to my problem but I'm not sure if it is and I'm not sure how it should be
used.
Note : I'm using the DirectoryEntry class in C#.Hello,
>> read about referrals which seems like a solution to my problem but I'm not sure if it is and I'm not sure how it should be used.
Here are some information I found on the MSDN which might help you:
Active Directory Searches Processes and Interactions
Avoid unnecessary SearchResultReference referral chasing
In the thread below, there is a code snpont shows the usage of this property:
https://social.technet.microsoft.com/Forums/windowsserver/en-US/fb338aed-4172-4132-a85e-f9bebdb74e00/when-does-adsi-refferal-chasing-work-?forum=winserverDS
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Need a query to list all the personalized objects under a given path
Hello Gurus,
Can you help me with a query that will give me a list of all personalized objects that are under a given path like /oracle/apps/per/...
Thanks,
VinodHi Vinod,
You can get the details from Functional Administrator responsibility, personalization tab, enter the "Document Path" like /oracle/apps/per
and check the "Personalized" checkbox. And you can import the personalization to the file system also. More details check the Note
The query
begin
jdr_utils.listcustomizations('/oracle/apps/pon/award/completion/webui/ponCompleteAward2PG');
end;
Will give the details for only one page.
Thanks.
With Regards,
Kali.
OSSi. -
Program to get all the query elements with UIDs with EN texts of a BW query
Hi All,
Need a program to get all the query elements with UIDs with EN and Other language texts, of a BW query.
We are doing a global implementation.
We are implementing Translations in French.
We need to see, the list of all UID's of a query, their EN texts and the FR texts.
Tried a bit, we are having the problem in getting the UIDs of the structure elements.
Thanks in advance,
Best Regards,
- ShashiHi ,
Below is the list of important tables related to query.
RSZELTDIR Directory of the reporting component elements
RSZELTTXT Texts of reporting component elements
RSZELTXREF Directory of query element references
RSRREPDIR Directory of all reports (Query GENUNIID)
RSZCOMPDIR Directory of reporting components
RSZRANGE Selection specification for an element
RSZSELECT Selection properties of an element
RSZELTDIR Directory of the reporting component elements
RSZCOMPIC Assignment reuseable component <-> InfoCube
RSZELTPRIO Priorities with element collisions
RSZELTPROP Element properties (settings)
RSZELTATTR Attribute selection per dimension element
RSZCALC Definition of a formula element
RSZCEL Query Designer: Directory of Cells
RSZGLOBV Global Variables in Reporting
RSZCHANGES Change history of reporting components
Hope this will help you...
Thanks,
Jitendra -
FBL3N Report -not able to get all the transaction code details
Hello,
when FBL3N report ran for one the expenses account (time paid off - project charges account) , only few line items are displaying the transaction code like CJ88 and CJ8G.
can you please tell me why all the line items are not showing the transactions codes and is there any know situation when the T- codes are not displayed.
What I need to do, to get all the T- codes in the report ?
I really appreciate your help.
Regards
RadhaI know it is a line item report and I was expecting to see the transaction code details in the report for every line item. But in I'm not able to see all T- codes for all the line items
Thanks
Radha -
Hi all,
The previous query is absolutely ok.
The only thing i want to change is ...
get all the previous available ve1 AND NEW: if a AGNR has no ve1-instance, regardless get an ve1-instance with the agnr filled but f.e. the other fields empty
The grouping could made in reporting-logic later, and not in the tsql-query.
resultset i need:
- all agnr, if the have an ve1-instance or not
Groups (hierarchy) i need, later in Report:
- AGNR
- ve1 (with all the left joind fields pg, vnfk, vnpk, vm (if they are)
- if a agnr has no instance of ve1 --> print: "NO ver available"
SELECT
ve1.new_verid,
ve1.new_no,
ve1.statuscode,
ve1.statuscodename,
ve1.createdon,
ve1.createdby,
ve1.createdbyname,
ve1.new_begin,
DATEPART(yyyy, ve1.new_begin) AS begin_year,
ve1.new_end,
ve1.new_vn_fid,
ve1.new_vn_fidname,
ve1.new_vn_kid,
ve1.new_vn_kidname,
vnpk.new_how_old,
ve1.new_vg,
ve1.new_vgname,
ve1.new_vs,
ve1.new_vsname,
ve1.new_vstat,
ve1.new_vstatname,
ve1.new_zw,
ve1.new_zwname,
ve1.new_bn_zw,
ve1.new_rlz_v,
ve1.new_pgid,
ve1.new_pgidname,
pg.accountnumber as pg_accountno,
ve1.new_agnr_agnr_avmid,
ve1.new_agnr_agnr_avmidname,
AGNR.new_vm_kid AS vm_contactid,
AGNR.new_vm_kidname AS vm_contactidname,
ve1.new_efv,
ve1.new_efvname,
CASE
WHEN ve1.new_vn_kid IS NOT NULL THEN 'Private Customer'
WHEN ve1.new_vn_fid IS NOT NULL THEN 'Account Customer'
ELSE 'Kunde'
END AS kunde_typ,
DATEPART(yyyy, vnpk.birthdate) as vnpk_birth_year,
CASE
WHEN ((ve1.new_rlz_v IS NOT NULL) OR (ve1.new_rlz_v > 0))
THEN ve1.new_rlz_v
WHEN (DATEPART(yyyy, ve1.new_begin) IS NOT NULL) AND (DATEPART(yyyy, vnpk.birthdate) IS NOT NULL)
THEN 65 - ((DATEPART(yyyy, ve1.new_begin)) - (DATEPART(yyyy, vnpk.birthdate)))
ELSE 20
END AS vlz_calc,
CASE
WHEN ((ve1.new_bnj IS NOT NULL) OR (ve1.new_bnj > 0)) THEN ve1.new_bnj
WHEN ((ve1.new_bn_zw IS NOT NULL) OR (ve1.new_bn_zw > 0))
THEN
CASE
WHEN new_zw = '100000008' THEN ve1.new_bn_zw * 12
WHEN new_zw = '100000004' THEN ve1.new_bn_zw * 4
WHEN new_zw = '100000002' THEN ve1.new_bn_zw * 2
WHEN new_zw = '100000001' THEN ve1.new_bn_zw * 1
WHEN new_zw = '100000006' THEN ve1.new_bn_zw
ELSE 0
END
ELSE 0
END AS bnj_calc
FROM
Filterednew_ver AS ve1
LEFT OUTER JOIN Filterednew_agnr AS AGNR
ON ve1.new_agnr_agnr_avmid = AGNR.new_agnrid
LEFT OUTER JOIN FilteredAccount AS pg
ON ve1.new_pgid = pg.accountid
LEFT OUTER JOIN FilteredAccount AS vnfk
ON ve1.new_vn_fid = vnfk.accountid
LEFT OUTER JOIN FilteredContact AS vnpk
ON ve1.new_vn_kid = vnpk.contactid
LEFT OUTER JOIN FilteredContact AS vm
ON AGNR.new_vm_kid = vm.contactid
WHERE
(ve1.createdon >= @Begin_Week)
AND (ve1.createdon <= @End_Week)
AND (ve1.new_vg = @vg)
AND (ve1.statuscode = '1')
AND (ve1.new_efv <> '100000000' OR ve1.new_efv IS NULL)
AND (ve1.new_vstat <> '100000004' OR ve1.new_vstat IS NULL)
AND (ve1.new_zw IN ('100000008','100000004','100000002','100000001','100000006'))
ORDER BY
ve1.createdon
i thought, and tried with right joins, but i think i need to change the sight (the complete query)?
thx for all kind of help
Greets PebHi Peb,
Please provide sample data and expected results. -
Need to get all the files, (well music and video), from my ipod touch 5th gen to my itunes libary. (So basically sync the other way to normal)
Laptop hard drive broke so had to buy a new one and obviously now need to sort out my itunes.
Did try downloading all my purchased stuff onto itunes but it has missed some things off, and there are some files I did not purchase from itunes so need a way of getting them back on there.
Sure this question has been asked a million times but can't find anything to help me on here so thought I'd ask.
-Did have a look at going onto the start menu and opening the hidden items thing but couldn't see any reference to ipod or device on it so wasn't sure how to do it that way.
-On itunes under my device when its connected, the section about manually restoring and backing up, would that help me? Because that says it will manually back up my ipod to my computer then could restore that back up, obviously I don't want to accidnetally get rid of everything on my ipod so didn't want to try that just in case without checking.
(And yes I have disabled auto sync to device when conncected!)
Can anyone help me please? Sorry if i've overcomplicated this!
Thanks:)
ChrisBacking up an iOS device will copy some data to a backup file within iTunes, but this excludes all media. You can also transfer iTunes Store purchases from the iDevice to iTunes but, without using a third-party tool, nothing else. As long as you do not sync the iPod with your new library, the media that's on it will remain ... for as long as it keeps functioning, is not lost, stolen, eaten by the dog, ...
You may also have an option to recover your previous library from your old laptop; as long as its hard drive isn't fried, a computer repair store or technician may be able to extract the drive, mount it in an external enclosure, and copy your data to another PC. Whatever you choose, there is no real alternative to having all your media on your computer, managed by iTunes, and regularly backed up to another device/location. -
my iphone has been water damaged and in the mean time ive gone back to using my old phone. But i need to get all the contacts from my iphone i had synced to my laptop, but i don't know where to find them and im not sure if ive backed them up to anything!
If your contacts are synced to your computer then they are in the supported app you are syncing with.
When you set up syncing of contacts on your device, which application did you select? -
Query for getting all function and procedure inside the packages
hi All
Please provide me Query for getting all function and procedure inside the packages
thanksAs Todd said, you can use user_arguments data dictionary or you can join user_objects and user_procedures like below to get the name of the packaged function and procedure names.
If you are looking for the packaged procedures and functions source then use user_source data dictionary
select a.object_name,a.procedure_name from user_procedures a,
user_objects b
where a.object_name is not null
and a.procedure_name is not null
and b.object_type='PACKAGE'
and a.object_name=b.object_name -
Urgent solution needed for the Problem ( get all the combination from table
we are having a table in following format
day | grpID | pktID
sun | 1 | 001
sun | 1 | 002
sun | 1 | 003
sun | 2 | 007
sun | 2 | 008
sun | 2 | 009
mon | 1 | 001
mon | 1 | 002
mon | 1 | 003
mon | 2 | 007
mon | 2 | 008
mon | 2 | 009
tue | 1 | 001
tue | 1 | 002
tue | 1 | 003
tue | 2 | 007
tue | 2 | 010
1. We have a combination of pkdIDs related with a specific grpID, for a particular day.
Ex: For Sunday, we have two combination list for grpID=1 is (001,002,003) and for group id = 2 is (007,008,009)
2. We need to get all the available combined pktid for each group id for all the days .
Eg the the expected result that is needed from the above table
(001,002,003)
(007,008,009)
(007,010)SQL> with tbl as
2 (select 'sun' d, 1 grp, '001' pk from dual union all
3 select 'sun' d, 1 grp, '002' pk from dual union all
4 select 'sun' d, 1 grp, '003' pk from dual union all
5 select 'sun' d, 2 grp, '007' pk from dual union all
6 select 'sun' d, 2 grp, '008' pk from dual union all
7 select 'sun' d, 2 grp, '009' pk from dual union all
8 select 'mon' d, 1 grp, '001' pk from dual union all
9 select 'mon' d, 1 grp, '002' pk from dual union all
10 select 'mon' d, 1 grp, '003' pk from dual union all
11 select 'mon' d, 2 grp, '007' pk from dual union all
12 select 'mon' d, 2 grp, '008' pk from dual union all
13 select 'mon' d, 2 grp, '009' pk from dual union all
14 select 'tue' d, 1 grp, '001' pk from dual union all
15 select 'tue' d, 1 grp, '002' pk from dual union all
16 select 'tue' d, 1 grp, '003' pk from dual union all
17 select 'tue' d, 2 grp, '007' pk from dual union all
18 select 'tue' d, 2 grp, '010' pk from dual) -- end of data sample
19 select distinct '('||ltrim(max(c1) keep (dense_rank last order by lv),',')||')'
20 from (select d,grp,level lv,sys_connect_by_path(pk,',') c1
21 from tbl
22 connect by d=prior d and grp = prior grp and pk > prior pk)
23 group by d,grp;
'('||LTRIM(MAX(C1)KEEP(DENSE_RANKLASTORDERBYLV),',')||')'
(001,002,003)
(007,008,009)
(007,010)
SQL>That works on 9i. Other possiblities on 10g.
Nicolas. -
Need user exit and runtime structure to get all the unsaved entries in CAT2
Hi Friends
As per our requirement, we need to compare all the entered hours from CAT2 vs Project level assigned hours.
If user save the record in CAT2, then no problem.I can get the records from CATSDB table.If user enter the record in first week and goes to next week without saving time entries in CAT2, Runtime structure catsd_imp-sumdays in user exit CATS0009 shows the current screen hours only.But I want to get all the entries entered in CAT2(Unsaved records).Is there any other user exit or badi available to get this functionalites.I tried with CATS0006 ,CATS0003 and so many user exits.But still I didnt get any solution for this.
If anyone come accross this kind of scenario,kindly help me on this.
Thanks
Gowrishankar
Edited by: gowrishankar p on Nov 1, 2010 2:24 PMHi
I didn;t find any badi for this transaction , check this onc CATS0010 once.
Regards
Siva
Maybe you are looking for
-
How can I install a jre on client machines with no Internet Access
Hi I have a lot of client machines located throughout the country which are connected to a central network (Oracle) application server. The client machines do not have internet access. The application now uses an applet which is accessible from the n
-
Hi guys , Actually I am looking for some info on this scenario. while creating PO for specific document type(ZPOG) and item category (L) , I need to modify the child material qty of the line item . This is subcontract PO . For example if I am creat
-
SQL Developer....tough to find the schema I am looking for
I am a contractor here and I have been given the host name/ user name / password for the database.I log in using SQL Developer tool ,and I see the tables ,views,indexes,packages etc and all are empty.Then below there is "Other Users" and underneath t
-
Hello, ever since I upgraded to the latest nightly builds about two weeks ago (SDK 4.1) I get the error mentioned above, and the design mode of Flash Builder 4 Beta 2 doesn't work any more: Design mode could not load he.enwipe.core.swc. It may be inc
-
Can I create a shortcut in Motion's file browser?
Does Motion 5's File Browser have somewhere to store shortcuts?