How to show grouped data in the same table?
Hi,
I am using JDev 11.1.1.2.0 with ADF 11g.
I have a below requirement
I have a tbl as below
Columns -==> RC TL Code
Data ==> 0 0 Prof
0 1 Prin
0 2 Tech
1 0 Prin
1 2 Prof
I prepared a query with a grouping on TL so that I can show my data as below
TL - 0
RC Code
0 Prof
1 Prin
TL - 1
RC Code
1 Prin
TL - 2
RC Code
0 Tech
2 Prof
Really confused on to what type of component should I use and how can the component be repeated once dragged and dropped onto the canvas. Is this possible using ADF? If not what is the alternative?
Thanks in advance.
Hi Bharat,
Unload the Repository and Delete the Table and fields in Hierarchy table and Recreate and reload the data.OIther wise you have to lot of manual work.
Thanks
Ganesh Kotti
Similar Messages
-
How to populate data in the same table based on different links/buttons
Hi
I'm using jdeveloper 11.1.4. I have a use case in which i need to populate data in the same table based on click of different links.
Can anyone please suggest how can this be achieved.
ThanksI have a use case in which i need to populate data in the same table based on click of different linksDo you mean that you need to edit existing rows ?
What format do you have the date in - table / form ? -
How can I POST data within the same page if I have a A HREF -tag as input?
How can I POST data within the same page if I have a <A HREF>-tag as input? I want the user to click on a line of text (from a database) and then some data should be posted.
you can use like this or call javascript fuction and submit the form
<form method=post action="/mypage">
cnmsdesign.doc
</form> -
How to show additional items in the same window using stacked canvas
How to show additional items in the same window using stacked canvas.
My content canvas has 14 items, and I have to include more.
I want to know how I can use a stacked canvas to show these additional items in the same window, so that I can scroll through horzontally , as if all the items are on one canvas.Well, I intially navigate into my content canvas. At this stage the stacked canvas is not visible, then how should I navigate to an item on the stacked canvas to make it visible?
-
I had an interview question that is:
How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) From another server ex: Transaction server?
Set up steps so inset, update or delete operation takes place across the servers.
It would be great if someone please enlighten me in details about this process in MS SQL Server 2008 R2.
Also please describe would it be different for SQL Server 2012?
If so, then what are the steps?I had an interview question that is:
How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) from another server ex: Transaction server?
Set up steps so that inset, update or delete operation gets done correctly across servers.
I was not sure about the answer, it would be great if someone please put some light on this and explain in details about this process in MS SQL Server 2008 R2.
Also it would be very helpful if you please describe would it be different for SQL Server 2012? If so, then what are the steps? -
How to read the hierarchy data from the same table using loop in AMDP method
Hi All,
We have a requirement to get the top partner from BUT050 table.
Here the Top parent is nothing but the top most in the hierarchy of the partners from BUT050.
Example:
For partner 1234 (BUT050-PARTNER1) there is partner 3523(BUT050-PARTNER2) one level above
For partner 3523(BUT050-PARTNER1) there is partner 4544 (BUT050-PARTNER2) last level .
so in this case for the partner 1234 the Top parent is 4544 .
I have created AMDP Procedure method to get the top-parnet and below given is the logic implemented in AMDP method.
Here i have implemented a recursive logic with the WHILE loop to get the top most hierarchy partner from the same table BUT050
IV_Parent is the input partner and ev_top_parent is the output value.
AMDP Procedure Method:
DECLARE lv_date VARCHAR(8) := TO_VARCHAR (current_date, 'YYYYMMDD');
DECLARE found INT := 1;
iv_partner1 = SELECT partner1 FROM but050
WHERE partner2 = iv_partner
AND reltyp = :iv_hierarchy
AND date_to >= :lv_date
AND date_from <= :lv_date;
WHILE found <> 0 do
select partner1 into ev_top_parent from :iv_partner1;
iv_partner1 = SELECT partner1 FROM but050
WHERE partner2 in ( select partner1 from :iv_partner1 where partner1 is not null)
AND reltyp = 'ZBP004'
AND date_to >= :lv_date
AND date_from <= :lv_date;
select COUNT ( partner1 ) INTO found FROM :IV_PARTNER1;
END WHILE;
This method is working fine, but here it is only taking one single partner and getting the top parent as output.
Now i would like to convert this mehtod so as to accept n number of partners (not one single partner) as input and should process each partner to get the top parent.
Could anyone guide me how can i handle the given AMDP method further so as to work some how it is within another loop from other AMDP method.
Thanks.
Regards,
Laxman.PHi
Go to SE11 and enter the hierarchy table name.
/BIC/H....(infoobject name)...and execute the table and select table entry and delete all....
Thanks
TG -
How to sum different column in the same table
Hi everyone
I would like to know how can I make the sum of different column in the same table using apex
exple:
TR_PROJ_BIL_TRIM.ENTPIDFISC as ENTPIDFISC,
TR_PROJ_BIL_TRIM.EXEANNEE as EXEANNEE,
TR_PROJ_BIL_TRIM.PROJBILTRIMT1PREV as PROJBILTRIMT1PREV,
TR_PROJ_BIL_TRIM.PROJBILTRIMT2PREV as PROJBILTRIMT2PREV,
trunc( TR_PROJ_BIL_TRIM.PROJBILTRIMT1PREV)+(TR_PROJ_BIL_TRIM.PROJBILTRIMT2PREV)
from TR_PROJ_BIL_TRIM TR_PROJ_BIL_TRIM
group by TR_PROJ_BIL_TRIM.ENTPIDFISC,TR_PROJ_BIL_TRIM.EXEANNEE
but while trying to run this script i get this error message:"ORA-00979: not a GROUP BY expression"
thanks for reading me and I hope to hear from you soonHi,
Your question do not have anything do with APEX.
It is pure SQL question and you will get better answer this kind questions from SQL and PL/SQL forum
You need have GROUP BY when you use aggregate functions like SUM.
I assume you like just add two columns.
Try
SELECT ENTPIDFISC
,EXEANNEE
,PROJBILTRIMT1PREV
,PROJBILTRIMT2PREV
,trunc(PROJBILTRIMT1PREV) + (PROJBILTRIMT2PREV)
FROM TR_PROJ_BIL_TRIM
Regards,
Jari -
How to hide committed data in the adf table
Hi,
I want to hide the existing data or committed data from the ADF Table when it loads.
When I press the create button the new record only should show.
How to do this?
Any suggestions please.
Thanks in advance,
SundarYou can use VO.setQueryMode(ViewObjectImp.QUERY_MODE_SCAN_UNPOSTED_ENTITY_ROWS) followed by VO.executeQuery() in this case.
http://docs.oracle.com/cd/E23549_01/apirefs.1111/e10653/oracle/jbo/ViewObject.html#QUERY_MODE_SCAN_UNPOSTED_ENTITY_ROWS
alternatively you can also iterate over the rowset and check the entity state of the current row to be STATUS_NEW else remove the row from the collection. -
How to compare two fields from the same table in the select statement
Hi, friends
I try to compare tow fields from the same table, but no result,
For example, this
data: cptotchek tyep i.
select count(*) into cptotchek
from aufk where erdat = aufk-idat2 .
The result is cptotchek = 0, but there are the records in aufk , where, aufk-erdat = aufk-idat2.
Please, help me, i don't use the loop statement for optimize my program.
RegardsHi ,
it will not return any value when you are using column of same table
such as Date Field , Because while Using Aggregate Function it will not check with self column
. For that you have to take data in one internal table and then you can work on it .
And if you are worried about Performance it will not affect , untill you are selecting only required data .
you can try this way .
data: cptotchek type i.
types : begin of w_aufk.
include structure aufk .
types : end of w_aufk .
data : it_aufk type standard table of w_aufk with header line .
select * into corresponding fields of table it_aufk
from aufk .
loop at it_aufk .
if it_aufk-erdat = it_aufk-idat2 .
write : / it_aufk-erdat , it_aufk-idat2 .
else .
delete it_aufk .
endif .
endloop.
Regards
Deepak. -
Historical and transaction data in the same tables creates perf problems
Our Oracle based application is slow partly due to the fact that historical data are kept in the same table as transactional data. For example records about deceased patients, patients treated 5 years ago...etc, are kept in the one and only one patient table, which is needed to run the daily process of the hospital. So gradually all our major tables PATIENTS, CHARTS, NAMES, APPOINTMENTS have grown very large and since most of our SQL join all these tables at the same time, then all screens and reports run very slowly. I have introduced the idea that we should split all these tables in two: historical PATIENTS data, and CURRENT PATIENTS data...the same with all the others. A nice system would first search in the smaller transactional tables, which would run faster being smaller, and if no data found, then fallback to the historical tables. But this would require programming. From what I have read mateialized view could solve part of our problem. We could have views containing for example only one year worth of the data, and I guess any changes could be later replicated in the base table. What I dont know is what to do if we cannot find the patient in the matealized views ? Do I need to fallback to another SQL which will search in the initial base tables ? Anyway we can implement this without programming ? Tx.
Appointment table: 207,470
Visit table: 5,890,920
Patient table: 2,993,129
Chart table: 2,864,069
Patient names table: 3,938,118
SELECT
APPOI_OR_VISIT,
VISIT_SEQ,
PAT_SEQ,
INST_CODE,
INST_CODE_DISPL,
INST_DESC,
CLINIC_CODE,
CLINIC_CODE_DISPL,
CLINIC_DESC,
SPEC_CODE,
SPEC_CODE_DISPL,
SPEC_DESC,
VISIT_DATE,
VISIT_TIME,
VISIT_TIME_ARRIVAL,
APPTYPE_CODE,
SESSION_DOM_MODE,
PRESTYPE_CODE,
PRESTYPE_DOM_TYPE,
DIA_CODE,
VISIT_TIME_START_RESP,
VISIT_TIME_DISCHARGE,
APPOI_NB_DURATION,
VISIT_TX_REASON,
VISIT_TX_COMMENT,
EXTDOC_CODE,
VISIT_PN_REFPHYS_NAME,
PATYPE_CODE,
PAYRESP_CODE,
VISIT_IND_GROUP,
VISIT_PCODE,
VISIT_IND_COMPLETE,
VISIT_IND_ADMISSION,
VISIT_IND_CONFIDENTIALITY,
VISIT_DATE_ACCIDENT,
APPOI_SEQ,
BILLING_CODE,
VISIT_TX_DIAGNOSIS,
CST_CODE_1,
CST_CODE_2,
CST_CODE_3,
APPOI_DH_CRE,
APPOI_CODE_CRE_USER,
APPOI_DH_MOD,
APPOI_CODE_MOD_USER,
VISIT_CODE_CRE_USER,
VISIT_DH_CRE,
VISIT_UPDATED_COUNT,
VISIT_CODE_MOD_USER,
VISIT_DH_MOD,
APPOI_PAYRESP_CODE,
APPOI_DT_ACCIDENT,
PATIENT_LAST_NAME,
PATIENT_FIRST_NAME,
PATIENT_CONFIDENTIALITY,
PATIENT_CHART_EXT,
TO_NUMBER(SUBSTR(PATIENT_CHART_EXT, 1, INSTR(PATIENT_CHART_EXT, '|')-1)) AS PATIENT_CHART_NO,
PAT_IND_SPECIAL_RISK
FROM
SELECT
'VISIT' AS APPOI_OR_VISIT,
VISIT.VISIT_SEQ,
VISIT.PAT_SEQ,
INSTITUTION.INST_CODE,
INSTITUTION.INST_CODE_DISPL,
INSTITUTION.INST_DESC,
CLINIC.CLINIC_CODE,
CLINIC.CLINIC_CODE_DISPL,
CLINIC.CLINIC_DESC,
SPECIALTY.SPEC_CODE,
SPECIALTY.SPEC_CODE_DISPL,
SPECIALTY.SPEC_DESC,
VISIT.VISIT_DATE,
VISIT.VISIT_TIME,
VISIT.VISIT_TIME_ARRIVAL,
VISIT.APPTYPE_CODE,
VISIT.SESSION_DOM_MODE,
VISIT.PRESTYPE_CODE,
VISIT.PRESTYPE_DOM_TYPE,
VISIT.DIA_CODE,
VISIT.VISIT_TIME_START_RESP,
VISIT.VISIT_TIME_DISCHARGE,
VISIT.APPOI_NB_DURATION,
VISIT.VISIT_TX_REASON,
VISIT.VISIT_TX_COMMENT,
VISIT.EXTDOC_CODE,
VISIT.VISIT_PN_REFPHYS_NAME,
VISIT.PATYPE_CODE,
VISIT.PAYRESP_CODE,
VISIT.VISIT_IND_GROUP,
VISIT.VISIT_PCODE,
VISIT.VISIT_IND_COMPLETE,
VISIT.VISIT_IND_ADMISSION,
VISIT.VISIT_IND_CONFIDENTIALITY,
VISIT.VISIT_DATE_ACCIDENT,
VISIT.APPOI_SEQ,
VISIT.BILLING_CODE,
VISIT.VISIT_TX_DIAGNOSIS,
VISIT.CST_CODE_1,
VISIT.CST_CODE_2,
VISIT.CST_CODE_3,
VISIT.APPOI_DH_CRE,
VISIT.APPOI_CODE_CRE_USER,
VISIT.APPOI_DH_MOD,
VISIT.APPOI_CODE_MOD_USER,
VISIT.VISIT_CODE_CRE_USER,
VISIT.VISIT_DH_CRE,
VISIT.VISIT_UPDATED_COUNT,
VISIT.VISIT_CODE_MOD_USER,
VISIT.VISIT_DH_MOD,
NULL AS APPOI_PAYRESP_CODE,
TO_DATE(NULL) AS APPOI_DT_ACCIDENT,
NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(VISIT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
PATIENT.PAT_IND_SPECIAL_RISK
FROM
AS_T_VISITS VISIT,
CT_R_INSTITUTIONS INSTITUTION,
AS_T_CLINICS CLINIC,
CT_R_SPECIALITIES SPECIALTY,
PI_T_NAMES NAME,
PI_T_PATIENTS PATIENT,
PI_R_CONF_LEVELS CONFIDENTIALITY
WHERE
VISIT_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
VISIT_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
CLINIC.CLINIC_CODE = VISIT.CLINIC_CODE AND
SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
INSTITUTION.INST_CODE(+) = VISIT.INST_CODE AND
NAME.PAT_SEQ = VISIT.PAT_SEQ AND
NAME.NAMTYP_CODE = 1 AND
PATIENT.PAT_SEQ = VISIT.PAT_SEQ AND
CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE
UNION
SELECT
'APPOI' AS APPOI_OR_VISIT,
0 AS VISIT_SEQ,
NVL(APPOINTMENT_GROUP.PAT_SEQ, APPOINTMENT.PAT_SEQ) AS PAT_SEQ,
INSTITUTION.INST_CODE,
INSTITUTION.INST_CODE_DISPL,
INSTITUTION.INST_DESC,
CLINIC.CLINIC_CODE,
CLINIC.CLINIC_CODE_DISPL,
CLINIC.CLINIC_DESC,
SPECIALTY.SPEC_CODE,
SPECIALTY.SPEC_CODE_DISPL,
SPECIALTY.SPEC_DESC,
APPOINTMENT.SESSION_DATE AS VISIT_DATE,
APPOINTMENT.APPOI_TIME AS VISIT_TIME,
'' AS VISIT_TIME_ARRIVAL,
APPOINTMENT.APPTYPE_CODE,
APPOINTMENT.SESSION_DOM_MODE,
0 AS PRESTYPE_CODE,
'' AS PRESTYPE_DOM_TYPE,
0 AS DIA_CODE,
'' AS VISIT_TIME_START_RESP,
'' AS VISIT_TIME_DISCHARGE,
APPOINTMENT.APPOI_NB_DURATION,
APPOINTMENT.APPOI_TX_REASON AS VISIT_TX_REASON,
APPOINTMENT.APPOI_TX_COMMENT AS VISIT_TX_COMMENT,
APPOINTMENT.EXTDOC_CODE,
APPOINTMENT.APPOI_PN_REFPHYS_NAME AS VISIT_PN_REFPHYS_NAME,
APPOINTMENT_TYPE.PATYPE_CODE AS PATYPE_CODE,
0 AS PAYRESP_CODE,
DECODE(APPOINTMENT_GROUP.PAT_SEQ,NULL,0,1) AS VISIT_IND_GROUP,
'' AS VISIT_PCODE,
0 AS VISIT_IND_COMPLETE,
0 AS VISIT_IND_ADMISSION,
APPOINTMENT.APPOI_IND_CONFIDENTIALITY AS VISIT_IND_CONFIDENTIALITY,
TO_DATE(NULL) AS VISIT_DATE_ACCIDENT,
APPOINTMENT.APPOI_SEQ,
0 AS BILLING_CODE,
'' AS VISIT_TX_DIAGNOSIS,
0 AS CST_CODE_1,
0 AS CST_CODE_2,
0 AS CST_CODE_3,
APPOINTMENT.APPOI_DH_CRE AS APPOI_DH_CRE,
APPOINTMENT.APPOI_CODE_CRE_USER AS APPOI_CODE_CRE_USER,
APPOINTMENT.APPOI_DH_MOD AS APPOI_DH_MOD,
APPOINTMENT.APPOI_CODE_MOD_USER AS APPOI_CODE_MOD_USER,
'' AS VISIT_CODE_CRE_USER,
SYSDATE AS VISIT_DH_CRE,
0 AS VISIT_UPDATED_COUNT,
'' AS VISIT_CODE_MOD_USER,
SYSDATE AS VISIT_DH_MOD,
PAYRESP_CODE AS APPOI_PAYRESP_CODE,
APPOI_DT_ACCIDENT,
NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(APPOINTMENT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
PATIENT.PAT_IND_SPECIAL_RISK
FROM
AS_T_APPOINTMENTS APPOINTMENT,
AS_R_APPOINTMENT_TYPES APPOINTMENT_TYPE,
AS_T_CLINICS CLINIC,
CT_R_SPECIALITIES SPECIALTY,
CT_R_INSTITUTIONS INSTITUTION,
AS_T_APPOINTMENT_GROUPS APPOINTMENT_GROUP,
PI_T_PATIENTS PATIENT,
PI_R_CONF_LEVELS CONFIDENTIALITY,
PI_T_NAMES NAME,
AS_T_APPOINTMENT_SEQ_MAPPING SEQMAP
WHERE
SESSION_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
SESSION_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
APPOINTMENT.APPOI_DOM_TYPE IN('A','AR') AND
CLINIC.CLINIC_CODE = APPOINTMENT.CLINIC_CODE AND
SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
INSTITUTION.INST_CODE(+) = APPOINTMENT.INST_CODE AND
APPOINTMENT_GROUP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
APPOINTMENT_TYPE.APPTYPE_CODE (+) = APPOINTMENT.APPTYPE_CODE AND
NAME.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
NAME.NAMTYP_CODE = 1 AND
PATIENT.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE AND
SEQMAP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
SEQMAP.APPOI_SEQ IS NULL
ORDER BY
VISIT_DATE, VISIT_TIME, PATIENT_CHART_NO -
Want to select individual data as well as aggregate data from the same table
want to select a, b from tab1 also need to find in the same table tab1 need to do sum(b) group by a
SELECT a,b,0 AS Ord
FROM tab1
UNION ALL
SELECT a,SUM(b),1
FROM tab1
GROUP BY a
ORDER BY a,Ord
assuming SQL Compact
If its SQL Server then we have much simpler methods
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Retrieve data from the same table
i have a table with following fields
emp_no,name,salary,department,dept_prev,prev_emp_no.
now i want retrieve emp_no,name,salary,department, from the data base for a perticular employeee number along with dept_prev
but dept_prev is the prev_emp_no dept_prev
now iam doing two query like this
first query to retreive name,salary,department
select name,salary,department from employee where emp_no = 10
second to retrieve the dept_prev from the same table but this
dept_prev must be based on prev_emp_no
select dept_prev from employee where emp_no in(select prev_emp_no from employee where emp_no =10)
can any one suggest to combine these two queries in a single sql statements, because all the fieldds are from the same table.
ThanksWould this one solve it?
SELECT emp.NAME, emp.salary, emp.department,
prev_emp.dept_prev
FROM employee emp,
employee prev_emp
WHERE emp.emp_no = 10
AND prev_emp.emp_no = emp.prev_emp_no;
not tested
C. -
How to delete entire data in the hierarchy table,?
hi friends
i need to delete entire data in the hierarchy table which contains parent child relationship,when i am selecting entire records and choose the option delete from the context menu, it is not deleting, and i have to delete one by one or i have delete first the child items and later parents items, it is time consuming process.
Is there any other option to delete entire records in the hierachy table , irrespective of parent and child relationship?
if any one have solution for my issue, please provide to me
thanks in advance
bharat.chinthapatlaHi Bharat,
Unload the Repository and Delete the Table and fields in Hierarchy table and Recreate and reload the data.OIther wise you have to lot of manual work.
Thanks
Ganesh Kotti -
Average time between diferrent dates in the same table
I am having a big problem trying to get this sentence for my report the thing is that I have a table name ca_parking
ca_parking (
id_parking number,
date_in date,
date_out date,
id_truck number,
id_user_rec number,
date_rec date);
where date_in and date_out are the day and time where truck get in and out of the building, id_parking is the pk of the table, id_truck is the fk from table ca_truck, id_user_rec is the user who enters the data on the system, anda date_rec is the date when the record is inserted.The company asked for an average of time spent by the trucks inside the parking lots so i need to use the date_in from one record less the date out from the next record of the same truck
id_parking date_in date_out id_truck id_user_rec date_rec
451794 03/07/2012 8:50:00 02/07/2012 20:00:00 36937 MFUERTE 02/07/2012 20:08:16
452580 05/07/2012 7:00:00 04/07/2012 20:15:00 36937 VCONTRERAS 04/07/2012 13:56:33
451591 02/07/2012 18:00:00 02/07/2012 13:00:00 47393 OVILLACIS 02/07/2012 13:39:40
451824 03/07/2012 17:00:00 03/07/2012 7:00:00 47393 OVILLACIS 03/07/2012 7:06:37
453160 05/07/2012 17:00:00 05/07/2012 14:50:00 47393 WALEMA 05/07/2012 14:57:51
So i need to do something like this
select avg(ca_parking.date_in - ca_parking.date_out), ca_trucks.trcuk_alias from ca_parking, ca_trucks where ca_parking.id_truck = ca_trucks.id_truck
group by ca_trucks.trcuk_alias
but i get only trash
I need it to do this for truck 36937 { (04/07/2012 20:15:00 - 03/07/2012 8:50:00) + (sysdate-05/07/2012 7:00:00)}/2 = 4.37
and fro truck 47393 { (03/07/2012 7:00:00 - 02/07/2012 18:00:00) + (05/07/2012 14:50:00 - 03/07/2012 17:00:00) + (sysdate - 05/07/2012 17:00:00)}/2 = 4.65
how can i get the following date_out less the previews date_inI am having a big problem trying to get this sentence for my report the thing is that I have a table name ca_parking
ca_parking (
id_parking number,
date_in date,
date_out date,
id_truck number,
id_user_rec number,
date_rec date);
where date_in and date_out are the day and time where truck get in and out of the building, id_parking is the pk of the table, id_truck is the fk from table ca_truck, id_user_rec is the user who enters the data on the system, anda date_rec is the date when the record is inserted.The company asked for an average of time spent by the trucks inside the parking lots so i need to use the date_in from one record less the date out from the next record of the same truck
id_parking date_in date_out id_truck id_user_rec date_rec
451794 03/07/2012 8:50:00 02/07/2012 20:00:00 36937 MFUERTE 02/07/2012 20:08:16
452580 05/07/2012 7:00:00 04/07/2012 20:15:00 36937 VCONTRERAS 04/07/2012 13:56:33
451591 02/07/2012 18:00:00 02/07/2012 13:00:00 47393 OVILLACIS 02/07/2012 13:39:40
451824 03/07/2012 17:00:00 03/07/2012 7:00:00 47393 OVILLACIS 03/07/2012 7:06:37
453160 05/07/2012 17:00:00 05/07/2012 14:50:00 47393 WALEMA 05/07/2012 14:57:51
So i need to do something like this
select avg(ca_parking.date_in - ca_parking.date_out), ca_trucks.trcuk_alias from ca_parking, ca_trucks where ca_parking.id_truck = ca_trucks.id_truck
group by ca_trucks.trcuk_alias
but i get only trash
I need it to do this for truck 36937 { (04/07/2012 20:15:00 - 03/07/2012 8:50:00) + (sysdate-05/07/2012 7:00:00)}/2 = 4.37
and fro truck 47393 { (03/07/2012 7:00:00 - 02/07/2012 18:00:00) + (05/07/2012 14:50:00 - 03/07/2012 17:00:00) + (sysdate - 05/07/2012 17:00:00)}/2 = 4.65
how can i get the following date_out less the previews date_in -
Query - Get data from the same table and field two times on a single line
I have prepared a query showing the bill of material. At each line each component will be a new line and I want to have the description of the material at the top (the master material composed of the component ones) and also the description of the component materials on the same line. This means that I should be able to use MAKT table 2 times on a single line of the query. I have used the query tool with SQ01 and SQ02 tcodes. How can I get the the description of the material at the top and also the description of the component material on a single line?
Thanks in advance for the answers.Yasar,
Any time you wish to use a table twice in an SQ01 query, you have to create an alias.
SQ02 > select the infoset, 'change' > go to Join definitions.
Select 'Alias' button. Create. Select your table name (such as MAKT) and define an alias, such as 'COMP_MAKT' for component descriptions.
Now you can insert the Alias table into your infoset just like it was a regular table, and use standard join method to join COMP_MAKT to your component material number.
Best regards,
DB49
Maybe you are looking for
-
I HAVE AN IPHONE 5S AND WANT TO USE SOFTWARE 7.0.2 BECAUSE IT IS COMPATIBLE WITH MY VEHICLE FOR UCONNECT. I CURRENTLY HAVE SOFTWARE 7.0.3 ON MY DEVICE. HOW WOULD I GET THE PREVIOUS SOFTWARE BACK ON MY PHONE
-
External Display won't go Fullscreen
I have an Intel-based iMac running Snow Leopard with an external display connected. I want to display fullscreen video on the external display but I'm having problems. Specifically, here is what happens: Firstly, the displays are not mirrored - which
-
Sharepoint Report is taking very long time to load
SharePoint(2010) Report is taking very long time to load and display in first attempt but from the next attempt it loads and display result normally. It's urgent..please help how to troubleshoot ...
-
Suddenly there's no sound while i use QT to play avi
i once could play most avi files in QT, but suddenly, i can't anymore, i haven't made any changes recently in Mac OS X, but have installed the Windows XP using BootCamp( some of the drivers which contained in the CD burned using BootCamp can't instal
-
How are the User screen and the Configuration screen Related in SPRO
Thanks