Last Record Navigation
Hi
When we use the last record navigation buton the system goes to max number of document, for example in sales order.
is possible that the last record buton goes to the last document of the period indicator active?
regards
VS
The functionality of the First, Prev, Next, Last buttongs are build into the core code of SBO and pressing last will always does to the highest number for that document.
If you are on Add mode, like Gordon says..pressing the Prev button would take you to the number before the current one.
Suda
Similar Messages
-
RANGE_PAGING LAST RECORD IN JSP PAGE
Hi.
I'm working in JDeveloper 10g, and I would like to know what should be the behavior for the Last button on a jsp page when I use the method setAccessMode with RANGE_PAGING mode?, I mean, when I press that button in my jsp page it doesn't go to the last record result of the query.
Thanks in advance.Thanks for your help.
My range size is 10.
But I have a question, vo.last does the same that the last button (navigation bar) on a jsp page?
For example, if I have navigated through 50 records (with nextSet button) and I press last button, and I know that the query result in the view object is 1000 records, but I'm using RANGE_PAGING, how can I go to the last record?
Because I tried with last button, but it goes to other record different to the last one.
Thanks in advance. -
How to get the last record??
Hi, I now have to get only the last record from one table
from MS Access.
I was looking for the useful method from API, however,
I cannot get it.
How to get only the last record from one table ???
Please help, thanks.In RDBMS, row order is really not relavent by iteself. Meaning there is no such thing as 'last record' unless it's in the context of a column (e.g. timeStamp).
Of course, rows are inserted and stored in some natural order, but you cannot assume they'll come back the same way in a 'Select *' as they were entered.
So, if you mean last row as in last inserted row, I would add a timestamp field that's set at insert, or use a autonumber column. Either way, have a column that will always contain the highest number or newest timestamp, and then you can build your where clause from that.
For instance, in Access, I have an autonumbered field called 'fred', with other columns. If I want the last record, I simply use the following:
select * from atable where fred in (SELECT max(fred) AS Max FROM atable);
the 'where in' clause will filter to only those records in the subsequent select statment, which of course is only one, the max of the column fred.
bRi -
How to get the last record from the database
I am using MS Access database and Swings as GUI. I want to get the last record of a particular column from the table and store it as a varaible.
Hi
To get Last record of resultset, you have pass some parameter in constructor of CreateStatement.In such case Resultset should be scrollable and Readonly
Example
objStatement=objCon.createStatement ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
mwwResultSet=cwwStatement.executeQuery(mwwSqlQuery);
while(mwwResultSet.next())
if(mwwResultSet.isLast())
//Fetch the required column record.
String abc=mwwResultSet.getString(1);
I think this will work. Try it.
bye -
How to get the last record of an internall table ....
Hi All..
i want to get the last record of an internal table itab, and i want the the value of the last record.Hi,
Use describe statment.
data: lv_line type i.
Describe table itab lines lv_line.
read table itab into wa_itab index lv_line.
regards,
Santosh Thorat -
Not enough space to print the last record on each page
Hello,
My report looks like a simple list table, with the first row as the column header, followed by rows of records.
The fields are placed on the Detail section and they're set with "Can Grow" property. That means, records may have different row height, some may take 1 row per record, some may take 3 rows per record, depending on the data length. I use some vertical lines on the Detail section as the column seperators, and a horizontal line as the record seperator.
I've a Page Footer to show the page number and print date.
My problem is:
When the space of the last record on the current page isn't big enough, the record will be printed automatically on the second page, which is fine. But the vertical seperation lines are still displayed even though the details are printed on the second page. I got some "empty rows with vertical seperation lines" or I'd say an open-end table at the end of some pages then.
Is there a way to avoid this?
Your help is much appreciated. Thank you.
AgnesYou could draw an outline box from page header to page footer, then your internal lines would run from page header to page footer
so if the document extends to 2 pages, the page footer will print on the 1st page and therefore the bottom line of the box
only problem now would be that on the 2nd page the box will extend to the bottom of that page also, even if there is only 1 record -
How do I display last record in database?
I have a asp guestbook form that I finally have working only
when the info is sent to me via email, it shows me the first entry
in the database each time. How do I get it to select/email only the
last entry?
Any advice is appreciated!"innovationlab" <[email protected]> wrote in
message
news:e8u951$1ll$[email protected]..
> Can't really be sorted, it just has name, email and
message.
Then you have no way of knowing which is the last record. You
need an
autonumber field or a date/time field in order to be able to
sort the
records so you know which one is the last.
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/
Cartweaver Development Team
http://www.cartweaver.com
Extending Knowledge Daily
http://www.communitymx.com/ -
How to get the first and the last record of every month within a time range in sql
I am trying to get the first record and the last record of each and every month in a given date range using sql. I have a sample code
where i have just selected everything within the date range now i have to extract the first and the last records of each and every month.
SELECT PurOrderNum,
OrderDate
FROM Purchasing.PurOrder
WHERE OrderDate >= '2013-02-28'
AND OrderDate <= '2014-12-29'SELECT PurOrderNum,
OrderDate
FROM
SELECT PurOrderNum,
OrderDate,
MAX(OrderDate) OVER (PARTITION BY DATEDIFF(mm,0,OrderDate)) AS MaxDate,
MIN(OrderDate) OVER (PARTITION BY DATEDIFF(mm,0,OrderDate)) AS MinDate
FROM Purchasing.PurOrder
WHERE OrderDate >= '2013-02-28'
AND OrderDate <= '2014-12-29'
)t
WHERE OrderDate = MaxDate
OR OrderDate = MinDate
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Cursor not working properly.. Gives every record last records' entry.
hi all.
a simple one for someone I'm sure...
Ive just added the cursor:
-- Cursor to get Oracle_Loc_Code from SU CHRIS vs ORACLE Locations Table into a variable..
CURSOR csr_ora_loc_code IS
SELECT sil.ORACLE_LOC_CODE
FROM SU_TEMPLOYEE_DETAILS std, SU_IEXP_LOCATIONS sil
WHERE std.STD_LOCATION_ID = sil.CHRIS_LOC_code;
..to the script I'll paste below in order to populate every record with whats in sil.ORACLE_LOC_CODE field.
But, although it works fine when you have 1 record to run in, when several records are to be loaded in together, the script, although enters the records into ORACLE fine, populates every record with the same location code - whatevers in the last record (instead of treating each one individually). How can I fix this?
Thanks for looking..
The code..
/* Formatted on 2009/04/29 11:52 (Formatter Plus v4.8.7) */
SET serveroutput ON SIZE 1000000 FORMAT WRAPPED
SET verify OFF
SET feedback OFF
DECLARE
-- Debugging/error handling
-- Work variables
ora_loc_code number := 0;
p_emp_number VARCHAR2 (14);
v_rec_cnt NUMBER := 0;
insert_flag VARCHAR2 (8);
err_num NUMBER;
err_msg VARCHAR2 (150);
err_line VARCHAR2 (350);
err_seq NUMBER := 0;
l_validate BOOLEAN DEFAULT FALSE;
l_std_business_group_id NUMBER := '0';
l_default_code_comb_id NUMBER := '217269';
l_organization_id NUMBER := '0';
l_set_of_books_id NUMBER := '1';
l_job_id NUMBER := '10';
l_obj NUMBER;
l_datetrack_update_mode VARCHAR2 (30) := 'CORRECTION';
l_assignment_sequence NUMBER;
l_name_combination_warning BOOLEAN := FALSE;
l_assign_payroll_warning BOOLEAN := FALSE;
l_org_now_no_manager_warning BOOLEAN;
l_other_manager_warning BOOLEAN;
l_spp_delete_warning BOOLEAN;
l_entries_changed_warning VARCHAR2 (30);
l_tax_district_changed_warning BOOLEAN;
l_person_id NUMBER;
l_assignment_id NUMBER;
l_special_ceiling_step_id NUMBER;
l_per_effective_end_date DATE:= TO_DATE ('11-Jul-2049', 'DD-MON-YYYY');
l_people_group_id NUMBER;
l_group_name VARCHAR2 (30);
l_assignment_number VARCHAR2 (35);
l_effective_end_date DATE := TO_DATE ('11-Jul-2049', 'DD-MON-YYYY');
l_date DATE := SYSDATE;
ip_p_address_id per_addresses.address_id%TYPE;
ip_p_object_version_number NUMBER;
ip_p_party_id per_addresses.party_id%TYPE;
l_per_object_version_number NUMBER;
l_asg_object_version_number NUMBER;
l_full_name VARCHAR2 (240);
l_per_comment_id NUMBER;
l_per_effective_start_date DATE;
l_concatenated_segments VARCHAR2 (240);
l_soft_coding_keyflex_id NUMBER;
l_comment_id NUMBER;
l_no_managers_warning BOOLEAN;
-- Get employee details info from work table
CURSOR get_employee_details
IS
SELECT std_hire_date, std_last_name, std_sex, std_date_of_birth,
std_email_address,
LPAD (std_employee_number, 8, '0') std_employee_number,
std_first_name, std_marital_status, std_middle_names,
std_nationality, std_title, std_national_identifier,
std_address_line1, std_address_line2, std_address_line3,
std_address_line4, std_post_code, std_telephone_1, std_country,
std_region, std_location_id, std_organization_id,
std_supervisor_id, std_person_id, std_position_id
FROM SU_TEMPLOYEE_DETAILS;
-- checks employee details info from PER_ALL_PEOPLE_F table
CURSOR c_check_employee (p_emp_number VARCHAR2)
IS
SELECT per.person_id, per.business_group_id, per.last_name,
per.start_date, per.date_of_birth, per.email_address,
per.employee_number, per.first_name, per.marital_status,
per.middle_names, per.nationality, per.national_identifier,
per.sex, per.title, padd.address_id, padd.primary_flag,
padd.address_line1, padd.address_line2, padd.address_line3,
padd.town_or_city, padd.postal_code, padd.telephone_number_1,
paas.assignment_number, paas.object_version_number
-- padd.telephone_number_2, padd.telephone_number_3, paas.job_id, paas.location_id,
-- paas.organization_id, paas.assignment_type, paas.supervisor_id,
-- paas.default_code_comb_id, paas.set_of_books_id, paas.period_of_service_id,
FROM per_all_people_f per,
per_all_assignments_f paas,
per_addresses padd
WHERE per.employee_number = p_emp_number
AND per.person_id = padd.person_id
AND paas.person_id(+) = per.person_id;
emp_rec c_check_employee%ROWTYPE;
-- Cursor retrieves latest Object Version Number from per_assignments_f table..
CURSOR csr_ovn (cp_person_id IN per_all_people_f.person_id%TYPE)
IS
SELECT MAX (paas.object_version_number)
FROM per_assignments_f paas, per_all_people_f per
WHERE paas.person_id = per.person_id
AND per.employee_number = paas.assignment_number
AND per.person_id = cp_person_id;
-- Cursor to get Oracle_Loc_Code from SU CHRIS vs ORACLE Locations Table into a variable..
CURSOR csr_ora_loc_code IS
SELECT sil.ORACLE_LOC_CODE
-- INTO ora_loc_code
FROM SU_TEMPLOYEE_DETAILS std, SU_IEXP_LOCATIONS sil
WHERE std.STD_LOCATION_ID = sil.CHRIS_LOC_code;
BEGIN
-- Process each record in the work table
FOR v_emp IN get_employee_details
LOOP
-- determine whether customer already exists
OPEN c_check_employee (v_emp.std_employee_number);
FETCH c_check_employee
INTO emp_rec;
IF c_check_employee%NOTFOUND
THEN
insert_flag := 'I';
DBMS_OUTPUT.PUT_LINE ('Employee No: ' || v_emp.std_employee_number);
ELSE
DBMS_OUTPUT.PUT (CHR (10));
insert_flag := 'X';
RAISE_APPLICATION_ERROR (-20001, 'Employee No: ' || v_emp.std_employee_number || ' already
exists - please UPDATE manually..' );
END IF;
CLOSE c_check_employee;
-- Obtain the most recent Object Version Number..
OPEN csr_ovn (v_emp.std_person_id);
FETCH csr_ovn
INTO l_obj;
-- IF csr_ovn%NOTFOUND THEN RAISE NO_DATA_FOUND; END IF;
CLOSE csr_ovn;
-- Open Oracle Location Code cursor
OPEN csr_ora_loc_code; -- (v_emp.std_person_id);
FETCH csr_ora_loc_code
INTO ora_loc_code;
CLOSE csr_ora_loc_code;
-- Create new PER_ALL_PEOPLE_F and PER_ADDRESSES record from
-- info in table record
IF insert_flag = 'I'
THEN
-- BEGIN -- Importing Employee Procedure --
Hr_Employee_Api.create_gb_employee
(p_validate => l_validate,
p_hire_date => v_emp.std_hire_date,
p_business_group_id => l_std_business_group_id,
p_date_of_birth => v_emp.std_date_of_birth,
p_email_address => v_emp.std_email_address,
p_first_name => v_emp.std_first_name,
p_middle_names => v_emp.std_middle_names,
p_last_name => v_emp.std_last_name,
p_sex => v_emp.std_sex,
p_ni_number => v_emp.std_national_identifier,
p_employee_number => v_emp.std_employee_number,
p_person_id => l_person_id,
p_title => v_emp.std_title,
p_assignment_id => l_assignment_id,
p_per_object_version_number => l_per_object_version_number,
p_asg_object_version_number => l_asg_object_version_number,
p_per_effective_start_date => l_per_effective_start_date,
p_per_effective_end_date => l_per_effective_end_date,
p_full_name => l_full_name,
p_per_comment_id => l_per_comment_id,
p_assignment_sequence => l_assignment_sequence,
p_assignment_number => l_assignment_number,
p_name_combination_warning => l_name_combination_warning,
p_assign_payroll_warning => l_assign_payroll_warning
Hr_Person_Address_Api.create_person_address
(p_validate => l_validate,
p_effective_date => v_emp.std_hire_date,
p_pradd_ovlapval_override => NULL,
p_validate_county => NULL,
p_person_id => l_person_id,
p_primary_flag => 'Y',
p_style => 'GB_GLB',
p_date_from => SYSDATE,
p_date_to => NULL,
p_address_type => NULL,
p_comments => NULL,
p_address_line1 => v_emp.std_address_line1,
p_address_line2 => v_emp.std_address_line2,
p_address_line3 => v_emp.std_address_line3,
p_town_or_city => v_emp.std_address_line4,
p_region_1 => NULL,
p_region_2 => NULL,
p_region_3 => NULL,
p_postal_code => v_emp.std_post_code,
p_country => v_emp.std_nationality,
p_telephone_number_1 => NULL,
p_telephone_number_2 => NULL,
p_telephone_number_3 => NULL,
p_party_id => ip_p_party_id,
p_address_id => ip_p_address_id,
p_object_version_number => l_obj
Hr_Assignment_Api.update_emp_asg
(p_validate => l_validate,
p_effective_date => SYSDATE, -- l_date,
p_datetrack_update_mode => l_datetrack_update_mode,
p_assignment_id => l_assignment_id,
p_object_version_number => l_obj,
p_supervisor_id => v_emp.std_supervisor_id,
p_default_code_comb_id => l_default_code_comb_id,
p_set_of_books_id => l_set_of_books_id,
p_concatenated_segments => l_concatenated_segments,
--IN/OUT
p_soft_coding_keyflex_id => l_soft_coding_keyflex_id,
--IN/OUT
p_comment_id => l_comment_id,
--IN/OUT
p_effective_start_date => l_date, --IN/OUT
p_effective_end_date => l_effective_end_date,
--IN/OUT
p_no_managers_warning => l_no_managers_warning,
--IN/OUT
p_other_manager_warning => l_other_manager_warning
--IN/OUT
Hr_Assignment_Api.update_emp_asg_criteria
(p_validate => l_validate,
p_effective_date => SYSDATE, -- l_date,
p_datetrack_update_mode => l_datetrack_update_mode,
p_assignment_id => l_assignment_id,
p_object_version_number => l_obj,
p_organization_id => l_organization_id,
p_location_id => ora_loc_code,
p_job_id => l_job_id,
p_position_id => v_emp.std_position_id,
p_special_ceiling_step_id => l_special_ceiling_step_id,
p_effective_start_date => l_date,
--per_effective_start_date,
p_effective_end_date => l_effective_end_date,
--IN/OUT
p_people_group_id => l_people_group_id,
--IN/OUT
p_group_name => l_group_name, --IN/OUT
p_org_now_no_manager_warning => l_org_now_no_manager_warning,
--IN/OUT
p_other_manager_warning => l_other_manager_warning,
--IN/OUT
p_spp_delete_warning => l_spp_delete_warning,
--IN/OUT
p_entries_changed_warning => l_entries_changed_warning,
--IN/OUT
p_tax_district_changed_warning => l_tax_district_changed_warning
--IN/OUT
v_rec_cnt := v_rec_cnt + 1;
DBMS_OUTPUT.PUT (CHR (10));
DBMS_OUTPUT.PUT_LINE ( 'There were '
|| v_rec_cnt
|| ' records read in..'
DBMS_OUTPUT.PUT (CHR (10));
-- End of customer related details
END IF;
END LOOP;
COMMIT;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
ROLLBACK;
WHEN OTHERS
THEN
ROLLBACK;
err_num := TO_CHAR (SQLCODE);
err_msg := SUBSTR (SQLERRM, 1, 150);
err_line := 'ORACLE error occurred processing record.. ' || err_msg;
DBMS_OUTPUT.PUT_LINE (err_line);
INSERT INTO SU_SL_ERRORS VALUES (err_num, err_msg, SYSTIMESTAMP);
END;
EXIT;CURSOR csr_ora_loc_code IS SELECT sil.ORACLE_LOC_CODE
-- INTO ora_loc_code
FROM SU_TEMPLOYEE_DETAILS std, SU_IEXP_LOCATIONS sil
WHERE std.STD_LOCATION_ID = sil.CHRIS_LOC_code; OPEN csr_ora_loc_code; -- (v_emp.std_person_id);
FETCH csr_ora_loc_code
INTO ora_loc_code;
CLOSE csr_ora_loc_code;Obviously yes.It will select one sil.ORACLE_LOC_CODE, as you are fetching one. That can be any one of the sil.ORACLE_LOC_CODE, as you didn't tell Oracle to pick a particular one.
If you want to get some particular sil.ORACLE_LOC_CODE, you need to put some filter on that. CURSOR csr_ora_loc_code(p_your_parameter NUMBER) IS -- whatever datatype you wan to pass
SELECT sil.ORACLE_LOC_CODE
-- INTO ora_loc_code
FROM SU_TEMPLOYEE_DETAILS std, SU_IEXP_LOCATIONS sil
WHERE std.STD_LOCATION_ID = sil.CHRIS_LOC_code
AND your_column = p_your_parameter;
OPEN csr_ora_loc_code(v_emp.std_person_id); -- (v_emp.std_person_id); -- I'm not sure why did you comment this out.
FETCH csr_ora_loc_code
INTO ora_loc_code;
CLOSE csr_ora_loc_code;By
Vamsi -
How to restrict the last record and not moving to next reocrd
1) how to restrict the last record and not moving to next reocrd.
2) Also for the F6 key(for new record).When you are on the last record, next-record will create a new one, so that my question is do you want to forbid new record creation.
Francois -
Problem Multiple record navigation in oracle forms
I retrieve multiple records using cursor fetch command in the select query i have given condition to retrieve details of employee no.
For example if we are giving an input as empno:100 then it retrieves two records of same emp no(100).It displays 2/3 records in the task bar when i navigate using push buttons it displays an empty record in the interface provided.(ie 3/3 records).How to avoid third unknown record displaying in the interface.most likely the problem is during the population of the block using the query.
i assume that you are creating one additional record after the last record from your query..
so this must be either with the CREATE_RECORD or NEXT_RECORD problem in the loop.so you should check in the loop first if the record exists, then do CREATE_RECORD or NEXT_RECORD. -
How to implement JSF text input down-arrow key = next record navigation?
Hi All,
I've got a small query which you experts might be able to help me through. I would not be surprised if such questions would already have been raised in this forum.
Formerly, I've created an Oracle Form that allow user to quickly insert data in bulk. It only has three 3 fields - first name, second name and address. Because of the flexibility of the Oracle Form, by pressing the down arrow key, user is able to create record when the last record is detected. And vice versa by hitting the up arrow key, it will move to the previous record when the current record is not the first record. So basically, the form is very 'key-driven' and without the use of the mouse, a lot of data can be inserted very quickly and efficiently.
I've successfully converted such form to an ADF BC JSF page using the JHeadstart toolkit. But when I showed it to my users for comment, they were really disappointed with the number of mouse interactions they need to click every time to navigate between records as well as creating new records. My question is can I build some sort of ADF JSF event handler on any of the text items to perform the following tasks:
1.) When 'down arrow key' is pressed AND not the last record THEN
Go to the next record.
2.) When 'down arrow key' is pressed AND is the last record THEN
Go to the next blank record.
3.) When 'up arrow key' is pressed AND not the first record THEN
Go to the previous record.
4.) When 'up arrow key' is pressed AND is the first record THEN
Do nothing.
If all the four above tasks are achievable in ADF JSF, can you please guide and brief me on the steps to implement them. Or these functionalities are already available somewhere in other open source toolkits. Your help is much appreciated. Thank you and have a nice day.
Kind Regards,
JohnHi Steven,
I've tried to incoporated attached link's codes with the JHeadstart generated code inside the jspx but I still cannot get it to work. There is a lot of Javascript error and is impossible to debug.
Regards,
John -
Select first and last records in grouped results - Oracle 11g
Say I have the following information in an Oracle 11g table:
Qty
Production order
Date and time
20
00000000000000001
12-JAN-14 00:02
20
00000000000000001
12-JAN-14 00:05
20
00000000000000001
12-JAN-14 00:07
20
00000000000000001
13-JAN-14 00:09
30
00000000000000002
12-JAN-14 00:11
30
00000000000000002
12-JAN-14 00:15
30
00000000000000002
12-JAN-14 00:20
30
00000000000000002
14-JAN-14 00:29
I would like to write a query that would return the following:
Qty
Production order
First
Last
80
00000000000000001
12-JAN-14 00:02
13-JAN-14 00:09
120
00000000000000002
12-JAN-14 00:11
14-JAN-14 00:29
That is, the sum of the Qty column grouped by Production order, and the date/time of the first and last records for each Production order.
I came up with a query that yielded this result:
Qty
Production order
First
Last
80
00000000000000001
12-JAN-14 00:02
14-JAN-14 00:29
120
00000000000000002
12-JAN-14 00:02
14-JAN-14 00:29
Which means that the First and Last columns show the overall first and last date / time of the whole table. Please note that this is a dummy table. Sorry I am now allowed to write the actual query
I came up with since work policies do not allow me to share it. Also, I tried with windowing functions such as rank()and row_number() but my user does not have enough privileges to do so.
Any help or hints will be greatly appreciated.Due to the fact that Oracle does not record the rows in any particular order, it would be wrong that the "first date" would be the first row processed by the query.
Therefore you would have to supply some other column if you do not want to consider the table as ordered by date.
Also, any analytical functions will need you to supply the "order by" and if its the date, then just a simple query will do:
SQL>WITH Tab1 (Qty, Production_Order, Pdate)
2 AS (SELECT 20, '00000000000000001', TO_DATE ( '12-JAN-14 00:02', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
3 SELECT 20, '00000000000000001', TO_DATE ( '12-JAN-14 00:05', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
4 SELECT 20, '00000000000000001', TO_DATE ( '12-JAN-14 00:07', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
5 SELECT 20, '00000000000000001', TO_DATE ( '13-JAN-14 00:09', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
6 SELECT 30, '00000000000000002', TO_DATE ( '12-JAN-14 00:11', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
7 SELECT 30, '00000000000000002', TO_DATE ( '12-JAN-14 00:15', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
8 SELECT 30, '00000000000000002', TO_DATE ( '12-JAN-14 00:20', 'DD-MON-YY HH24:MI') FROM DUAL UNION ALL
9 SELECT 30, '00000000000000002', TO_DATE ( '14-JAN-14 00:29', 'DD-MON-YY HH24:MI') FROM DUAL)
10 SELECT SUM ( Qty), Production_Order, MIN ( Pdate), MAX ( Pdate)
11 FROM Tab1
12 GROUP BY Production_Order
13* ORDER BY Production_Order
SQL> /
SUM(QTY) PRODUCTION_ORDER MIN(PDATE) MAX(PDATE)
80 00000000000000001 12-Jan-2014 00:02:00 13-Jan-2014 00:09:00
120 00000000000000002 12-Jan-2014 00:11:00 14-Jan-2014 00:29:00 -
Function in select statement need to be called only for the last record.
Select state,
local,
fun_state_loc_other_details(19) details
from state_local
where pm_key=19
resuts:_
State Local Details
AP APlocal details1
UP UPLocal details1
MP MPLocal details1
i) The above query returns 100 records
ii) fun_state_loc_other_details is also getting called 100 times. But I want this function to be called only for the last record that is 100th record.
is there any way to do that?Thanks amatu.
One more small query. Can I do it on condition based.
Select state,
local,
fun_state_loc_other_details(19) details
from state_local
where pm_key=19
Like if one state it need to be called once.
AP -- 50 records
UP - 20 records
MP -- 10 records.
fyi: this record no. varies
I want the function to be called for AP once, UP once, MP once. -
Function to return a value of a object based on last record by date
Post Author: Tned
CA Forum: Desktop Intelligence Reporting
Can anyone assit with a method/formula to return the a value of an object based on the last record by date. BO 5 or XI. See example below. Query structure is not an issue. Only need help with the last record function or aggregate.
Data Table
ID / Serial #
Date
Status
Condition
Abc1
01/01/08
1
A
Abc1
01/02/08
1
Z
Abc1
01/02/08
3
Z
Abc1
01/04/08
2
D
Abc1
01/05/08
5
E
Abc2
01/01/08
1
F
Abc2
01/02/08
2
Z
Desired query results. Only the values of the latest records returned.
ID / Serial #
Status
Condition
Abc1
5
E
Abc2
2
ZPost Author: Tned
CA Forum: Desktop Intelligence Reporting
Thanks Prashant
However, when i add either the status or condition variables to the report all lines related to the ID are returned not just the last entery by date.
Thanks again.Terry
Maybe you are looking for
-
Short table name in SELECT statement
Does Oracle support anything like the following sintax: SELECT * FROM TABLE1 AS T1 Thanks in advance
-
How do i uninstall third party software
I just purchased a Mac Pro Restina this week end, so am new to Macs and Lion.....I have installed a 3rd party software that i would like to uninstall. How do I do this?
-
Install errors in IDCS5.5
I am getting errors when I try to install the Folio Producer Tools and the Folio Builder Panel. (Mac, ID CS5.5) I was working fine until this morning when the Folio Builder Panel had me update it. The install didn't work and I got an error. Then I w
-
Won't update to 10.5.5
I recently got a macbook pro and it was (and still is) on 10.5.2. The first thing I did when I started it up was update everything. When it got to installing 10.5.5, it said that it had to restart and so I clicked install and it went to restart with
-
I have lost my iphone4s help me
guys i have lost my iphone and box while shifting my home.i need to fing imei number and i have lost my box while shifting home.so is there any way that i can find my imei number.i have my apple id singed in and i have recently buy whatapp through my