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
Similar Messages
-
Format first and last record of result query
Hello
I have the following query
<tt>select 1 seq, 'This is First record' data from dual union all
select 2, 'Data ' || tname from tab union all
select 3, 'This was last record Last record' from dual
order by 1</tt>
When i spool this statement to a listfile with col seq noprint option i get:
This is First record
Data MLA_ACCESS_LIST
Data MLA_APPLICATIONS
Data MLA_VPD_PCK
Data MLA_VPD_TABLES
This was last record Last record
But i want:
This is First record MLA_ACCESS_LIST
Data MLA_APPLICATIONS
Data MLA_VPD_PCK
MLA_VPD_TABLES This was last record Last record
I tried it with 1 statement with usage of lead and lag, because first and last record have to differ from the other result records. But i get ORA-30484: missing window specification for this function
Is this possible with 1 statement or am i doomed to edit the results by myself?
Thanks Aukeselect case row_number() over (order by tname)
when 1 then 'This is the First record '
end || tname ||
case row_number() over (order by tname desc)
when 1 then ' This was the last record'
end
from tab
order by tname
hth -
Fetch first and last record together
Hi All,
I want to fetch first and last records. I have done through ROWNUM, but I need some alternative ways, may be through RANK function.
Please help on this.
here sample data:
WITH t AS
(SELECT 100 sid, 'ABC' SNAME, 4 status_id, SYSDATE + 1/24 start_date FROM dual UNION ALL
SELECT 100 sid, 'ABC' SNAME, 5 status_id ,SYSDATE + 2/24 start_date FROM dual UNION ALL
SELECT 100 sid, 'ABC' SNAME, 6 status_id ,SYSDATE + 3/24 start_date FROM dual UNION ALL
SELECT 100 sid, 'ABC' SNAME, 7 status_id ,SYSDATE + 3/24 start_date FROM dual UNION ALL
SELECT 100 sid, 'ABC' SNAME, 8 status_id ,SYSDATE + 4/24 start_date FROM dual)
SELECT * FROM t ORDER BY start_date;Thanks,if you want all the info on the same row.
/* Formatted on 10/19/2011 7:06:50 AM (QP5 v5.149.1003.31008) */
WITH t AS (SELECT 100 sid,
'ABC' SNAME,
4 status_id,
SYSDATE + 1 / 24 start_date
FROM DUAL
UNION ALL
SELECT 100 sid,
'ABC' SNAME,
5 status_id,
SYSDATE + 2 / 24 start_date
FROM DUAL
UNION ALL
SELECT 100 sid,
'ABC' SNAME,
6 status_id,
SYSDATE + 3 / 24 start_date
FROM DUAL
UNION ALL
SELECT 100 sid,
'ABC' SNAME,
7 status_id,
SYSDATE + 3 / 24 start_date
FROM DUAL
UNION ALL
SELECT 100 sid,
'ABC' SNAME,
8 status_id,
SYSDATE + 4 / 24 start_date
FROM DUAL)
SELECT sid,
sname,
MIN (status_id) KEEP (DENSE_RANK FIRST ORDER BY start_date) min_status,
MIN (start_date) min_dt,
MAX (status_id) KEEP (DENSE_RANK FIRST ORDER BY start_date DESC)
max_status,
MAX (start_date) max_dt
FROM t
GROUP BY sid, sname
SID SNAME MIN_STATUS MIN_DT MAX_STATUS MAX_DT
100 ABC 4 10/19/2011 8:05:54 AM 8 10/19/2011 11:05:54 AMEdited by: pollywog on Oct 19, 2011 7:11 AM -
Hi everybody,
I have problem with first and last record.How can I specified that current record is first and last record.
it means that is any statement exist that determine :System.first_record is equal to :System.last_record.
It's very emergancy.
Thanks for your attention and your help.
/ShivaYou can try this:
if :system.cursor_record = '1' and :system.last_record = 'TRUE' then
-- this is the only record in block
end if;
Hi everybody,
I have problem with first and last record.How can I specified that current record is first and last record.
it means that is any statement exist that determine :System.first_record is equal to :System.last_record.
It's very emergancy.
Thanks for your attention and your help.
/Shiva -
Is it possible to select multiple layers by selecting first and last layers?
I frequently get Illustrator files in that have individual objects such as paths on individual layers that could be grouped to make the layers more concise. I find that I have to shift click each individual layer to select it to eventually group it. At times, I have 25 or so layers that I need to select. Is there a way to select the first and last layer in the layers palette, and have Illustrator select all layers in between?
Katrina,
And I guess it's the way I work. 1) I routinely select objects by selecting them from the layers palette, and not the canvas, so that I can't accidentally move an object that is the clients artwork. I prefer to work this way, as I consider it "safer". (I lock layers I'm not using) I routinely run into artists work that for instance, converted fonts to outline, and now each compound layer that is an individual letter is an object on it's own layer. 2) I need things grouped together and titled so that if I need to come back to this file and quickly fix something on press, I can tell what layer holds what object.
3) Therefore, I frequently need to select objects in a two mile long (slight exaggeration ) list of layers/sublayers and group them, retaining them in their same layers in the event an effect has been applied at the top hiearchy of that layer.
It would be great if a key, or combination of keys, would allow me to select the top object, scroll down and select the last object, and have Illustrator select all between those two.
If you create and use selections as suggested in post #12, you do have to select individual objects when they share layers with other objects (but you can select whole layers as well) in exactly the way you are used to (1), but you only have to do it once instead of having to repeat it (3), and you have them collected with a title so you can find them again (2).
At least it is part of the way. -
How to get the first and last record
Hai All
I have table called T1 and there are more than 8 lakhs records and i have a column called Timestamp so i need to get the first record value and time stampvalue and last record and time stamp value so that i can conclude that For Example
form 13 june to 15 june data are here
Kind Regards
SrikkanthMSomething like this can also indicate the first and last rows as you query...
SQL> select empno, ename, hiredate
2 ,case row_number() over (order by hiredate)
3 when 1 then 'First Row'
4 when count(*) over () then 'Last Row'
5 end as flag
6 from emp;
EMPNO ENAME HIREDATE FLAG
7369 SMITH 17/12/1980 00:00:00 First Row
7499 ALLEN 20/02/1981 00:00:00
7521 WARD 22/02/1981 00:00:00
7566 JONES 02/04/1981 00:00:00
7698 BLAKE 01/05/1981 00:00:00
7782 CLARK 09/06/1981 00:00:00
7844 TURNER 08/09/1981 00:00:00
7654 MARTIN 28/09/1981 00:00:00
7839 KING 17/11/1981 00:00:00
7900 JAMES 03/12/1981 00:00:00
7902 FORD 03/12/1981 00:00:00
7934 MILLER 23/01/1982 00:00:00
7788 SCOTT 19/04/1987 00:00:00
7876 ADAMS 23/05/1987 00:00:00 Last Row
14 rows selected.
SQL> -
SQL (first and last record)
Hi All,
WITH t AS
SELECT 100 region_id, 1001 Client_Id, 'client 1' Client_Name, 1 Status_id, 'progress' Status_name, SYSDATE + 1 Start_Date, SYSDATE + 1 End_Date FROM dual UNION ALL
SELECT 100 region_id, 1001 Client_Id, 'client 1' Client_Name, 2 Status_id, 'hold' Status_name ,SYSDATE + 1 Start_Date, SYSDATE + 1 End_Datet FROM dual UNION ALL
SELECT 100 region_id, 1001 Client_Id, 'client 1' Client_Name, 3 Status_id ,'reject' Status_name, SYSDATE + 1 Start_Date, SYSDATE + 1 End_Date FROM dual UNION ALL
SELECT 200 region_id, 1002 Client_Id, 'client 2' Client_Name, 1 Status_id, 'progress' Status_name, SYSDATE + 1 Start_Date, SYSDATE + 1 End_Date FROM dual UNION ALL
SELECT 200 region_id, 1002 Client_Id, 'client 2' Client_Name, 2 Status_id, 'hold' Status_name ,SYSDATE + 1 Start_Date, SYSDATE + 1 End_Datet FROM dual UNION ALL
SELECT 200 region_id, 1002 Client_Id, 'client 2' Client_Name, 3 Status_id ,'reject' Status_name, SYSDATE + 1 Start_Date, SYSDATE + 1 End_Date FROM dual UNION ALL
SELECT 200 region_id, 1002 Client_Id, 'client 2' Client_Name, 3 Status_id ,'progress' Status_name, SYSDATE + 1 Start_Date, SYSDATE + 1 End_Date FROM dual
SELECT * FROM t;Desired output:
REGION_ID CLIENT_ID CLIENT_NAME STATUS_ID STATUS_NAME START_DATE END_DATE
100 1001 client 1 1 progress 9/3/2011 12:26 9/3/2011 12:26
100 1001 client 1 3 reject 9/3/2011 12:26 9/3/2011 12:26
200 1002 client 2 1 progress 9/3/2011 12:26 9/3/2011 12:26thanks,Hi,
Like Sven, I don't understand why you only want one output row for client_id=1002. Also, I don't understand what order determine "first" and "last". It's hard to guess because so many of the columns have the same value on every row.
My best guess is that status_id plays a part in deciding who is "first" and "last", and that you don't want to include ties (multiple rows with a equal claim to being "first" or "last") in the output.
WITH got_analytics AS
SELECT t.* -- or whatever columns you want to display
, ROW_NUMBER () OVER ( PARTITION BY region_id
, client_id
, client_name
ORDER BY end_date
, start_date
, status_id
) AS a_num
, ROW_NUMBER () OVER ( PARTITION BY region_id
, client_id
, client_name
ORDER BY end_date DESC
, start_date DESC
, status_id DESC
) AS d_num
, COUNT (*) OVER ( PARTITION BY region_id
, client_id
, client_name
, end_date -- NOTE: no ORDER BY
, start_date
, status_id
) AS cnt
FROM t
-- WHERE ... -- if you need any filtering, this is where it goes
SELECT region_id, client_id, client_name, status_id, start_date, end_date
FROM got_analytics
WHERE ( a_num = 1
OR d_num = 1
AND cnt = 1
ORDER BY region_id, client_id, client_name, start_date, end_date, status_id
;If client_name and region_id depend on client_id, then you don't need to include them in the PARTITION BY clauses. Depending on your requirements, you may not want them in the PARTITION BY clauses even if they are independent of client_id. Then again, you may not want client_id in th PARTITION BY clauses. It all depends on what you're trying to do. -
Getting first and last records of sql using a analytical function query
hi all!
Thanks in advance for looking at my problem! I have a query that runs against a table that keep all records
of changes on another table (journal table kind of thing). I wrote a sql that would tell what the status of that
requisition was, what came next and its respective dates. However, that would bring a lot of rows. I only need
to see the first row and last couple say 3 last rows. How could I achieve that?
SELECT ano yr,
numero id,
jn_datetime,
status_siafi status,
lead(status_siafi) over(PARTITION BY ano, numero ORDER BY jn_datetime) next_status,
lead(jn_datetime) over(PARTITION BY ano, numero ORDER BY jn_datetime) date_next_status,
MAX(jn_datetime) over(PARTITION BY ano, numero) last_update,
MIN(jn_datetime) over(PARTITION BY ano, numero) first_update
FROM nl_compensado_jn
WHERE ano = '08'
AND numero = '113747'
GROUP BY ano,
numero,
jn_datetime,
status_siafi
YR ID JN_DATETI S N DATE_NEXT LAST_UPDA FIRST_UPD
08 113747 11-SEP-08 1 2 11-SEP-08 20-NOV-08 11-SEP-08
08 113747 11-SEP-08 2 3 12-SEP-08 20-NOV-08 11-SEP-08
08 113747 12-SEP-08 3 2 12-SEP-08 20-NOV-08 11-SEP-08
08 113747 12-SEP-08 2 3 15-SEP-08 20-NOV-08 11-SEP-08
08 113747 15-SEP-08 3 2 15-SEP-08 20-NOV-08 11-SEP-08
08 113747 15-SEP-08 2 3 16-SEP-08 20-NOV-08 11-SEP-08
08 113747 16-SEP-08 3 2 16-SEP-08 20-NOV-08 11-SEP-08
08 113747 16-SEP-08 2 3 17-SEP-08 20-NOV-08 11-SEP-08
08 113747 17-SEP-08 3 2 17-SEP-08 20-NOV-08 11-SEP-08
08 113747 17-SEP-08 2 3 18-SEP-08 20-NOV-08 11-SEP-08
08 113747 18-SEP-08 3 2 18-SEP-08 20-NOV-08 11-SEP-08
08 113747 18-SEP-08 2 3 19-SEP-08 20-NOV-08 11-SEP-08
08 113747 19-SEP-08 3 2 19-SEP-08 20-NOV-08 11-SEP-08
08 113747 19-SEP-08 2 3 23-SEP-08 20-NOV-08 11-SEP-08
08 113747 23-SEP-08 3 2 24-SEP-08 20-NOV-08 11-SEP-08
08 113747 24-SEP-08 2 3 25-SEP-08 20-NOV-08 11-SEP-08
08 113747 25-SEP-08 3 2 25-SEP-08 20-NOV-08 11-SEP-08
08 113747 25-SEP-08 2 3 26-SEP-08 20-NOV-08 11-SEP-08
08 113747 26-SEP-08 3 2 26-SEP-08 20-NOV-08 11-SEP-08
08 113747 26-SEP-08 2 3 29-SEP-08 20-NOV-08 11-SEP-08
08 113747 29-SEP-08 3 2 29-SEP-08 20-NOV-08 11-SEP-08
08 113747 29-SEP-08 2 3 02-OCT-08 20-NOV-08 11-SEP-08
08 113747 02-OCT-08 3 2 02-OCT-08 20-NOV-08 11-SEP-08
08 113747 02-OCT-08 2 3 03-OCT-08 20-NOV-08 11-SEP-08
08 113747 03-OCT-08 3 2 03-OCT-08 20-NOV-08 11-SEP-08
08 113747 03-OCT-08 2 3 06-OCT-08 20-NOV-08 11-SEP-08
08 113747 06-OCT-08 3 2 06-OCT-08 20-NOV-08 11-SEP-08
08 113747 06-OCT-08 2 3 07-OCT-08 20-NOV-08 11-SEP-08
08 113747 07-OCT-08 3 2 07-OCT-08 20-NOV-08 11-SEP-08
08 113747 07-OCT-08 2 3 08-OCT-08 20-NOV-08 11-SEP-08
08 113747 08-OCT-08 3 2 08-OCT-08 20-NOV-08 11-SEP-08
08 113747 08-OCT-08 2 3 09-OCT-08 20-NOV-08 11-SEP-08
08 113747 09-OCT-08 3 2 09-OCT-08 20-NOV-08 11-SEP-08
08 113747 09-OCT-08 2 3 10-OCT-08 20-NOV-08 11-SEP-08
08 113747 10-OCT-08 3 2 14-OCT-08 20-NOV-08 11-SEP-08
08 113747 14-OCT-08 2 3 15-OCT-08 20-NOV-08 11-SEP-08
08 113747 15-OCT-08 3 2 15-OCT-08 20-NOV-08 11-SEP-08
08 113747 15-OCT-08 2 3 16-OCT-08 20-NOV-08 11-SEP-08
08 113747 16-OCT-08 3 2 16-OCT-08 20-NOV-08 11-SEP-08
08 113747 16-OCT-08 2 3 17-OCT-08 20-NOV-08 11-SEP-08
08 113747 17-OCT-08 3 2 17-OCT-08 20-NOV-08 11-SEP-08
08 113747 17-OCT-08 2 3 21-OCT-08 20-NOV-08 11-SEP-08
08 113747 21-OCT-08 3 2 21-OCT-08 20-NOV-08 11-SEP-08
08 113747 21-OCT-08 2 3 22-OCT-08 20-NOV-08 11-SEP-08
08 113747 22-OCT-08 3 2 22-OCT-08 20-NOV-08 11-SEP-08
08 113747 22-OCT-08 2 3 23-OCT-08 20-NOV-08 11-SEP-08
08 113747 23-OCT-08 3 2 23-OCT-08 20-NOV-08 11-SEP-08
08 113747 23-OCT-08 2 3 27-OCT-08 20-NOV-08 11-SEP-08
08 113747 27-OCT-08 3 2 27-OCT-08 20-NOV-08 11-SEP-08
08 113747 27-OCT-08 2 3 28-OCT-08 20-NOV-08 11-SEP-08
08 113747 28-OCT-08 3 2 28-OCT-08 20-NOV-08 11-SEP-08
08 113747 28-OCT-08 2 3 29-OCT-08 20-NOV-08 11-SEP-08
08 113747 29-OCT-08 3 2 29-OCT-08 20-NOV-08 11-SEP-08
08 113747 29-OCT-08 2 3 30-OCT-08 20-NOV-08 11-SEP-08
08 113747 30-OCT-08 3 2 30-OCT-08 20-NOV-08 11-SEP-08
08 113747 30-OCT-08 2 3 31-OCT-08 20-NOV-08 11-SEP-08
08 113747 31-OCT-08 3 2 31-OCT-08 20-NOV-08 11-SEP-08
08 113747 31-OCT-08 2 3 03-NOV-08 20-NOV-08 11-SEP-08
08 113747 03-NOV-08 3 2 03-NOV-08 20-NOV-08 11-SEP-08
08 113747 03-NOV-08 2 3 06-NOV-08 20-NOV-08 11-SEP-08
08 113747 06-NOV-08 3 2 06-NOV-08 20-NOV-08 11-SEP-08
08 113747 06-NOV-08 2 3 07-NOV-08 20-NOV-08 11-SEP-08
08 113747 07-NOV-08 3 2 07-NOV-08 20-NOV-08 11-SEP-08
08 113747 07-NOV-08 2 3 10-NOV-08 20-NOV-08 11-SEP-08
08 113747 10-NOV-08 3 2 10-NOV-08 20-NOV-08 11-SEP-08
08 113747 10-NOV-08 2 3 12-NOV-08 20-NOV-08 11-SEP-08
08 113747 12-NOV-08 3 2 12-NOV-08 20-NOV-08 11-SEP-08
08 113747 12-NOV-08 2 3 13-NOV-08 20-NOV-08 11-SEP-08
08 113747 13-NOV-08 3 2 13-NOV-08 20-NOV-08 11-SEP-08
08 113747 13-NOV-08 2 3 14-NOV-08 20-NOV-08 11-SEP-08
08 113747 14-NOV-08 3 2 14-NOV-08 20-NOV-08 11-SEP-08
08 113747 14-NOV-08 2 3 17-NOV-08 20-NOV-08 11-SEP-08
08 113747 17-NOV-08 3 2 17-NOV-08 20-NOV-08 11-SEP-08
08 113747 17-NOV-08 2 3 18-NOV-08 20-NOV-08 11-SEP-08
08 113747 18-NOV-08 3 2 18-NOV-08 20-NOV-08 11-SEP-08
08 113747 18-NOV-08 2 2 18-NOV-08 20-NOV-08 11-SEP-08
08 113747 18-NOV-08 2 3 19-NOV-08 20-NOV-08 11-SEP-08
08 113747 19-NOV-08 3 2 19-NOV-08 20-NOV-08 11-SEP-08
08 113747 19-NOV-08 2 4 20-NOV-08 20-NOV-08 11-SEP-08
08 113747 20-NOV-08 4 20-NOV-08 11-SEP-08
80 rows selected.thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!
gleisson henriquesorry!!!!! didn't notice that major detail!!!
insert into nl_compensado_jn values ('INS','LETICIA','11-SEP-08 15:08:27','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','1','');
insert into nl_compensado_jn values ('UPD','BELLA','19-SEP-08 07:43:20','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','18-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','15-SEP-08 07:45:54','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','12-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','11-SEP-08 15:34:30','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','11-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','16-SEP-08 13:48:38','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','16-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','18-SEP-08 07:44:12','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','17-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','16-SEP-08 07:38:29','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','15-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','19-SEP-08 16:13:20','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','19-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','18-SEP-08 15:33:59','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','18-SEP-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','15-SEP-08 15:35:52','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','15-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','02-OCT-08 07:51:38','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','29-SEP-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','26-SEP-08 08:11:04','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','25-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','29-SEP-08 15:46:31','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','29-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','29-SEP-08 12:12:29','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','26-SEP-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','08-OCT-08 07:44:06','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','07-OCT-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','09-OCT-08 07:44:43','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','08-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','03-OCT-08 07:44:57','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','02-OCT-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','06-OCT-08 07:41:19','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','03-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','17-SEP-08 07:35:00','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','16-SEP-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','03-OCT-08 15:17:09','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','03-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','23-SEP-08 16:05:01','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','19-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','25-SEP-08 07:37:44','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','24-SEP-08');
insert into nl_compensado_jn values ('UPD','GERENTE','26-SEP-08 15:57:35','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','26-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','24-SEP-08 15:31:40','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','24-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','12-SEP-08 08:02:34','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','11-SEP-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','09-OCT-08 15:04:27','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','09-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','17-SEP-08 15:31:46','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','17-SEP-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','07-OCT-08 07:51:57','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','06-OCT-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','07-OCT-08 15:04:54','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','07-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','02-OCT-08 15:49:48','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','02-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','25-SEP-08 15:36:45','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','25-SEP-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','06-OCT-08 15:00:08','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','06-OCT-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','08-OCT-08 14:57:23','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','08-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','12-SEP-08 15:31:47','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','12-SEP-08');
insert into nl_compensado_jn values ('UPD','BELLA','06-NOV-08 10:04:08','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','03-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','10-NOV-08 14:11:55','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','07-NOV-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','23-OCT-08 15:08:23','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','23-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','31-OCT-08 14:59:36','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','31-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','28-OCT-08 10:33:59','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','27-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','16-OCT-08 08:01:41','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','15-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','29-OCT-08 11:04:35','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','28-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','17-OCT-08 07:58:07','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','16-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','22-OCT-08 10:36:15','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','21-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','21-OCT-08 13:08:38','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','17-OCT-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','23-OCT-08 10:49:52','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','22-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','27-OCT-08 10:12:47','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','23-OCT-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','16-OCT-08 15:36:47','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','16-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','14-OCT-08 15:19:24','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','14-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','03-NOV-08 09:10:26','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','31-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','15-OCT-08 07:59:37','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','14-OCT-08');
insert into nl_compensado_jn values ('UPD','ANTUNES','10-OCT-08 11:25:23','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','09-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','03-NOV-08 16:01:49','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','03-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','29-OCT-08 15:13:36','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','29-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','22-OCT-08 15:25:48','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','22-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','30-OCT-08 10:22:24','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','29-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','30-OCT-08 15:15:47','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','30-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','17-OCT-08 15:19:19','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','17-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','06-NOV-08 16:08:43','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','06-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','31-OCT-08 10:42:10','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','30-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','07-NOV-08 16:01:50','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','07-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','21-OCT-08 15:34:07','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','21-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','27-OCT-08 15:22:24','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','27-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','28-OCT-08 15:16:19','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','28-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','15-OCT-08 15:15:54','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','15-OCT-08');
insert into nl_compensado_jn values ('UPD','BELLA','07-NOV-08 09:39:43','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','06-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','17-NOV-08 09:29:29','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','14-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','12-NOV-08 09:40:53','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','10-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','18-NOV-08 09:49:53','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','17-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','19-NOV-08 15:29:15','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084810','16660','2','19-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','10-NOV-08 15:25:03','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','10-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','13-NOV-08 09:10:07','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','12-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','14-NOV-08 10:33:24','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','3','13-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','12-NOV-08 15:32:54','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','12-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','17-NOV-08 15:37:10','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','17-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','19-NOV-08 09:14:38','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084810','16660','3','18-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','20-NOV-08 09:06:16','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084810','16660','4','19-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','14-NOV-08 15:19:03','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','14-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','18-NOV-08 15:47:14','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','18-NOV-08');
insert into nl_compensado_jn values ('UPD','BELLA','13-NOV-08 15:29:06','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084110','16660','2','13-NOV-08');
insert into nl_compensado_jn values ('UPD','HEBER','18-NOV-08 18:41:45','','TRIGER25','','08','113747','00','00003','84110','08','DV','540638','11-SEP-08','WX01208201001760084810','16660','2','18-NOV-08'); -
Getting first and last records of a query(on a table)
Hello,
i want to display the first and the last serial number(table: OBJK ) against a particulat matnr and obknr.
how do i display only the first and only the last record of my query ?
hope i am comprehendedable..
Thanks..
ShehryarSELECT min(sernr) max(sernr) into lfirst llast
from objk
where matnr = pmatnr
and obknr = pobknr.
---Lets say you already have the data in the internal table in that case..
SORT itab by SERNR.
read table itab index 1.
lfirst = itab-sernr.
sort itab by sernr descending.
read table itab index 1.
llast = itab-sernr.
Regards
Anurag
Message was edited by: Anurag Bankley
Message was edited by: Anurag Bankley -
Selection first n(20 )records from result page
Hi,
I have a requirement where the the users want to select first n(20) record from the result page after applying the date filter . They want to see all results and then select the records say first 50.I do not want to select manually clicking( browsing on page).Any thoughts how this can be achieved like adding text box at frame so that I can give number .Hello Senthil,
why you want to create one more textbox... you can achieve your requirement by entering 20 in "maximum number of fields". It will give first 20 results.
If you want to add one more textbox for your purpose then tell me.
Thanks and Regards,
Amit Singh -
Java 1.6.0_05 does not recognize first and last property in jnlp file
Hi
Has anybody else seen this?
The jnlp file contains five properties, but the JRE does not recognize the first nor the last property.
It has been working great since 1.4.2, through 1.5 and 1.6 until 1.6.0_05.
<property name='bog' value='%2fdata%2fkirkeboeger1892%2f'/>
<property name='opslag' value='aa001/AB/007/0000a-A.Jpg,aa001/AB/007/0002a-F.Jpg,... </property>
<property name='sessionId' value='ed0l5n55yu2h04alvqxdpbn3'/>
<property name='service' value='http://ao.sa.dk/LAView/ImageServer/Service1.asmx'/>
<property name='titel' value='1908+-+1924%2c+Agerskov%2c+N%c3%b8rre+Rangstrup%2c+Haderslev'/>The 'opslag' property is much longer, so I cut it off to make it more readable.
Pressing 's' in the console gives me this
Dump system properties ...
awt.toolkit = sun.awt.windows.WToolkit
file.encoding = Cp1252
file.encoding.pkg = sun.io
file.separator = \
http.auth.serializeRequests = true
https.protocols = TLSv1,SSLv3
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.awt.printerjob = sun.awt.windows.WPrinterJob
java.class.path = C:\Program Files\Java\jre1.6.0_05\lib\deploy.jar
java.class.version = 50.0
java.endorsed.dirs = C:\Program Files\Java\jre1.6.0_05\lib\endorsed
java.ext.dirs = C:\Program Files\Java\jre1.6.0_05\lib\ext;C:\Windows\Sun\Java\lib\ext
java.home = C:\Program Files\Java\jre1.6.0_05
java.io.tmpdir = C:\Users\MAJ-BR~1\AppData\Local\Temp\
java.library.path = C:\Program Files\Java\jre1.6.0_05\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jre1.6.0_05\bin;C:\Program Files\Mozilla Firefox;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;"C:\Program Files\Java\jre1.6.0_05\bin"
java.protocol.handler.pkgs = com.sun.javaws.net.protocol|com.sun.deploy.net.protocol
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.6.0_05-b13
java.security.policy = file:C:\Program Files\Java\jre1.6.0_05\lib\security\javaws.policy
java.specification.name = Java Platform API Specification
java.specification.vendor = Sun Microsystems Inc.
java.specification.version = 1.6
java.vendor = Sun Microsystems Inc.
java.vendor.url = http://java.sun.com/
java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
java.version = 1.6.0_05
java.vm.info = mixed mode, sharing
java.vm.name = Java HotSpot(TM) Client VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Sun Microsystems Inc.
java.vm.specification.version = 1.0
java.vm.vendor = Sun Microsystems Inc.
java.vm.version = 10.0-b19
javaplugin.proxy.config.type = direct
javawebstart.version = javaws-1.6.0_05
jnlpx.heapsize = 64m,128m
jnlpx.home = C:\Program Files\Java\jre1.6.0_05\bin
jnlpx.jvm = "C:\Program Files\Java\jre1.6.0_05\bin\javaw.exe"
jnlpx.remove = false
jnlpx.splashport = 49557
line.separator = \r\n
opslag = aa001/AB/007/0000a-A.Jpg,aa001/AB/007/0002a-F.Jpg,...
os.arch = x86
os.name = Windows Vista
os.version = 6.0
path.separator = ;
service = http://ao.sa.dk/LAView/ImageServer/Service1.asmx
sessionId = ed0l5n55yu2h04alvqxdpbn3
sun.arch.data.model = 32
sun.boot.class.path = C:\Program Files\Java\jre1.6.0_05\lib\resources.jar;C:\Program Files\Java\jre1.6.0_05\lib\rt.jar;C:\Program Files\Java\jre1.6.0_05\lib\sunrsasign.jar;C:\Program Files\Java\jre1.6.0_05\lib\jsse.jar;C:\Program Files\Java\jre1.6.0_05\lib\jce.jar;C:\Program Files\Java\jre1.6.0_05\lib\charsets.jar;C:\Program Files\Java\jre1.6.0_05\classes;C:\Program Files\Java\jre1.6.0_05\lib\javaws.jar;C:\Program Files\Java\jre1.6.0_05\lib\deploy.jar
sun.boot.library.path = C:\Program Files\Java\jre1.6.0_05\bin
sun.cpu.endian = little
sun.cpu.isalist = pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
sun.desktop = windows
sun.io.unicode.encoding = UnicodeLittle
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = Cp1252
sun.management.compiler = HotSpot Client Compiler
sun.os.patch.level =
trustProxy = true
user.country = DK
user.dir = C:\Users\Maj-Britt\Documents
user.home = C:\Users\Maj-Britt
user.language = da
user.name = Maj-Britt
user.timezone = Europe/Paris
user.variant = As one can clearly see, the 'bog' and 'titel' (i.e. first and last) properties are missing, resulting (bad code - I know) in a NullPointerException.We also have this problem, but it's not first and last property.
We have 6 properties, and the 3. property is gone.
If I download the jnlp file, the property is there, if I choose show jnlp file in "javaws -viewer" it's not there. Only difference between this property and the working properties is length.
The length is char 255, and the data is base64 encoded.
I worked fine before upgrading to Java 6 update 5.
Anyone any ideas? -
How do I easily select a group of emails in Apple Mail if I want to delete them? In other words, what do I select if I mark the first and last email to delete everything in between? Thanks.
I have this same issue. I have over 100 email addresses that I need to add to a group. The issue is not making the group, it's getting the email addresses from Mail to Contacts.
Dragging the email addresses does nothing. You can copy the addresses, but there's nowhere to put them. You can make a VCF for an email address, but then you have to find all of them to add them to the group. How do you automate this?!
I'm astounded that there's so little support for such a common issue for which people have been asking for years. -
Query : first and last 25 records of a table
Hi @ll,
i am going to write a query for a report. Therefor i need the first and last 25 records of a table. Does anyone got an idea for a solution ? I was trying to achieve this by using a WHERE clause. Here is a part of the query :
SELECT
TOP 10 T1.[ItemCode], DATEPART(mm, T1.[DocDate]) [.....]
FROM FROM INV1 T1
Where T1.[DocDate] >= Cast('2009 [......] AND
T1.ItemCode = (
SELECT TOP 10 T40.[ItemCode]
FROM DBO.OINM
WHERE Where T40.[DocDate] >= Cast('2009-04-01 00:00:00' AS datetime)
AND T40.[DocDate] <= Cast('2009-04-30 00:00:00' AS datetime)
GROUP BY T1.[ItemCode], DATEPART(mm, T40.[DocDate])
ORDER BY SUM(T1.[TotalSumSy]) ASC)
The where part i would use twice, once for ascending the other one for descending. But it does not work.
Any ideas ?
Regards SteffenHi,
Union was the keyword, that i was searching for. It is a nice way, but not practible.
We are using coresuite for generating reports, and there were a nice possibility to connect diffrent queries.
Thanks for your suggestion.
Regards Steffen -
Finding first and last members of a group set
Is there any example how to use 'first' and 'last' functions in an sql query ?
I have tried to execute a query like this on the scott.emp table :
select deptno,min(sal),max(sal),first(sal) from emp group by deptno;
but I always get this message:
ERROR at line 1:
ORA-00904: "FIRST": invalid identifier
btw I use Oracle RDBMS ver 9.1.0.3 for Solaris in my server.
tx for your help
sjarifSyarif,
The FIRST and LAST functions, which became available with 9i, are used to find the first or last member of a ranked set. I'm not sure exactly what you are trying to do, but I can show you a query that should work (I don't have 9i handy at the moment). This query should give you the departments with the highest (first) and lowest (last) aggregate salaries:
select deptno,
min(deptno)
keep (dense_rank first order by sum(sal) desc) highest_sal,
min(deptno)
keep (dense_rank last order by sum(sal) desc) lowest_sal
from emp
group by deptno
Is there any example how to use 'first' and 'last' functions in an sql query ?
I have tried to execute a query like this on the scott.emp table :
select deptno,min(sal),max(sal),first(sal) from emp group by deptno;
but I always get this message:
ERROR at line 1:
ORA-00904: "FIRST": invalid identifier
btw I use Oracle RDBMS ver 9.1.0.3 for Solaris in my server.
tx for your help
sjarif -
Query to find first and last call made by selected number for date range
Hi,
query to find first and last call made by selected number for date range
according to filter:
mobile_no : 989.....
call_date_from : 25-april-2013
call_date_to : 26-april-2013
Please helpHi,
It sounds like you want a Top-N Query , something like this:
WITH got_nums AS
SELECT table_x.* -- or list columns wanted
, ROW_NUMBER () OVER (ORDER BY call_date ) AS a_num
, ROW_NUMBER () OVER (ORDER BY call_date DESC) AS d_num
FROM table_x
WHERE mobile_no = 989
AND call_date >= DATE '2013-04-25'
AND call_date < DATE '2013-04-26' + 1
SELECT * -- or list all columns except a_num and d_num
FROM got_nums
WHERE 1 IN (a_num, d_num)
;This forum is devoted to the SQL*Plus and iSQL*Plus front ends. This question doesn't have anything to do with any front end, does it? In the future, you'll get better response if you post questions like this in the PL/SQL.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the SQL forum FAQ {message:id=9360002}
Maybe you are looking for
-
Archivelog errors...EVERYTHING CHECKS OUT!?
10.2.0 HPUX I don't know if anyone has ever come across this before. But I was receiving errors that archiving couldn't find valid locations ORA-16014: log 1 sequence# 18959 not archived, no available destinations ORA-00312: online log 1 thread 1: '/
-
Dear All, There are three radio buttons displayed while editing the Addresses in ESS. The valid from option always defaults the date to current system date. Can the date on this option be set to blank and not as a default system date. I have tried us
-
Change the Time Zone???
Hi, I need to change the System Time Zone to all the users in the XI environment but I don't remember how is the process... Someone can explain me how is it? Thanks!
-
How to Upload and Download and run video in webcenter portal
using java and oracle Database and windows media player
-
Report Designer: No Authorization Save Report ???
Hello, I'd like to save a report. After entering Technical Name and Description the System says: "You do not have the necessary authorization to perform this action." Does anyone know which authorization I need to add? Thank you Daniel