How to get historical data?
Hi, experts, how do?There is a backup task assignment table.
do stain no employee to track the start date to follow (JMA)
1 Peter 03/01/2011
1 jack 02/01/2011
1 Marie 01/01/2011
2 Marie 03/01/2011
2 Peter 01/01/2011
How to write a query to get.
No employee to track the start date (DMY) end date to follow (JMA) following tasks
1 Peter 03/01/2011 today, or null
1 plug 1/2/2011-28/2/2011
1-mary 1/1/2011, 1/31/2011
2 Marie 03/01/2011 today, or null
2 Peter 1/1/2011-28/2/2011
Forreging wrote:
on January 1, it is attributed to Pierre
on March 1, he went to Mary.
as a result, task2 is attributed to Pierre since 01/01/2011 to 28/02/2011
In this case of partition of task_no, instead
SQL> WITH src AS (
SELECT 1 task_no,'peter' emp ,TO_DATE('1/3/2011','DD/MM/YYYY') start_date FROM DUAL UNION
SELECT 1 ,'jack', TO_DATE('1/2/2011','DD/MM/YYYY') FROM DUAL UNION
SELECT 1 ,'mary', TO_DATE('1/1/2011','DD/MM/YYYY') FROM DUAL UNION
SELECT 2 ,'mary', TO_DATE('1/3/2011','DD/MM/YYYY') FROM DUAL UNION
SELECT 2 ,'peter', TO_DATE('1/1/2011','DD/MM/YYYY') FROM DUAL)
--
--
SELECT task_no, emp, start_date,
lead(start_date-1) over (partition by task_no order by start_date) end_date
FROM src
order by task_no, start_date;
TASK_NO EMP START_DATE END_DATE
---------- ----- ---------- ----------
1 mary 01/01/2011 31/01/2011
1 jack 01/02/2011 28/02/2011
1 peter 01/03/2011
2 peter 01/01/2011 28/02/2011
2 mary 01/03/2011
5 rows selected.
Tags: Database
Similar Questions
-
How to get the Date, month, year of the DateTimePicker
Hi, I am using the DateTimePicker.
There are several question about this command:
1. how to get the Date, month and year?
-With the help of myDateTime.value, I get this string ' Wed May 08 14:45 ICT 2013 '-> I have to manually analyze this? Because I need in format yyyy/mm/dd. Or can set the format of dateTimePicker.value?
2 format on dateTimePicker self (on the user interface) is d/m/YY, I can't change to another format?
Thank you
dateTimePicker.value return a QDateTime not a string.
https://developer.BlackBerry.com/Cascades/reference/bb__cascades__datetimepicker.html#property-value
See more:
https://developer.BlackBerry.com/Cascades/reference/QDateTime.html#date
https://developer.BlackBerry.com/Cascades/reference/QDate.html
You can get
day = dateTimePicker.value.date().day() month = dateTimePicker.value.date().month() year= dateTimePicker.value.date().year() dateYYYYMMDD = dateTimePicker.value.date().toString(Qt::ISODate) dateYYYYMMDD2 = dateTimePicker.value.date().toString("YYYY/MM/DD") dateYYYYMMDD3 = dateTimePicker.value.toString("YYYY/MM/DD")
-
How to get the date for the first Monday of each month
Dear members,
How to get the date for the first Monday of each month.
I wrote the following code
SELECT decode (to_char (trunc (sysdate + 30, 'MM'), 'DAY'), 'MONDAY', trunc (sysdate + 30, 'MM'), NEXT_DAY (trunc (sysdate + 30, 'MM'), "LUN")) FROM DUAL
But he looks at complex bith.
Abhishek
Published by: 9999999 on 8 March 2013 04:30Use the IW format - it will make independent NLS solution. And all you need is truncated 7th day of each month using IW:
select sysdate current_date, trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month from dual / CURRENT_D FIRST_MON --------- --------- 08-MAR-13 04-MAR-13 SQL>
Here is the list of the first Monday of the month of this year:
with t as( select add_months(date '2013-1-1',level-1) dt from dual connect by level <= 12 ) select dt first_of_the_month, trunc(dt + 6,'iw') first_monday_the_month from t / FIRST_OF_ FIRST_MON --------- --------- 01-JAN-13 07-JAN-13 01-FEB-13 04-FEB-13 01-MAR-13 04-MAR-13 01-APR-13 01-APR-13 01-MAY-13 06-MAY-13 01-JUN-13 03-JUN-13 01-JUL-13 01-JUL-13 01-AUG-13 05-AUG-13 01-SEP-13 02-SEP-13 01-OCT-13 07-OCT-13 01-NOV-13 04-NOV-13 FIRST_OF_ FIRST_MON --------- --------- 01-DEC-13 02-DEC-13 12 rows selected. SQL>
SY.
-
How does the historical Data.vi rename? I get the error-1967386622
What format is required for entries to rename history Data.vi?
No matter what I try, I can't make it work, I get the error-1967386622:
HIST_RenameNodesCORE.VI, Citadel: (Hex 0x8ABC1002) the item specified, like computer, path or a folder cannot be found.
Given this hypothetical hierarchy in the Citadel 5 universe in MAX, that entries are to ZZZ and rename XXX?
-My computer (PC)
-C__DB
-AAA
+ AAA_Process_Name
(traces)
-ZZZ
+ ZZZ_Process_Name
(traces)
Thank you!!
This knowledge base article describes exactly this error. The syntax is a bit complicated but sometimes. To rename the ZZZ xxx entries, the following entries in the VI rename historical data:
name of the database: C_DB
current name: \\ZZZ\
new name: \\XXX\
And for the ZZZ process:
name of the database: C_DB
current name: \\ZZZ\ZZZ_Process_Name
new name: \\ZZZ\XXX_Process name
To change the folder and the name of the process, we would have run the VI twice through. Hope this helps some!
-
How to get a date to the timestamp of a file XML format
Hello
I'm trying to get a date from an external XML file. My XML file looks like this:
<>http://www.NI.com/LVData">
8.6.1
Date of birth
31/03/1983
I can get the system to retrieve the correct XML element that shows the
nested and elements , but I have no way to retrieve correctly the date. It seems as if she interprets my date seconds since 1904. I try to keep the "readable" for the end user XML, so it is important to keep this date in standard U.S. date format. I eventually uses this date to calculate the age of something. I labour code to subtract a timestamp in the format of the date to the current date and time, but I can't access it when I get back from XML. Starting from XML schema, it looks like the timestamp element requires a cluster... but there is no documentation on what to spend. Any ideas how to get back an XML date in this format in a simple and clean?
Here's my current VI:
Thank you
Ryan
Cambridge, MY
Quick Tip on "bundle by name. You don't need to consolidate all these constants where the values correspond to what is the constant of cluster at the top. The cluster constant defines the data structure and the starting values. Simply group the values for specific change items.
Example of tone would be a bit cleaner. Although the format string should use a capital T.
As always with dealing with the time, complications could arise due to dealing with time zones and leap years. Zones shouldn't matter for the calculation of the years since you are rounded up to years. Although you probably want to round down rather than round at most closely. (I forgot this part in my example). The problem with leap years when you would be only in a certain number of days of the anniversary, he would round up the age. The number of rounded days would depend on how much on leap days that nobody has seen in their lifetime.
-
How to get api data to Analytics?
Hi, I want to use the response to generate data for my js to customize and create a new report that does not build in obiee.
Is there an api response data to call? How to get it?
You have the Web service interface that allows you to run LSQL and retrieve data: http://docs.oracle.com/cd/E28280_01/bi.1111/e16364/methods.htm#BIEIT180
Or if you just want to do a record in JS, you can always do in an analysis: using view narrative, you can pass the data from your analysis to a JS object and use any JS code, you want to do the rendering (OBIEE analysis is nothing other than the Web page in the end...)
-
How to get the data in the table if the date is less - than two months from the current date?
Hi all
I have a requirement in to retrieve table data. If any of the basic date in the column data.
I have a date field (expiration date) I need to display data which expires two months.
Please give me a solution.
Concerning
Shankar
Hi, Shankar,
Sorry, we don't know what you want.
If you want something which, when executed on March 13, 2014, finds all the lines where expires and is located between March 13, 2014 and may 13, 2014, inclusive,
SELECT *- or whatever the columns that you want to
FROM table_x
WHERE expire > = TRUNC (SYSDATE)
Maturity AND< add_months="" (trunc="" (sysdate)="" ,="" 2)="" +="">
;
I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
Explain, using specific examples, how you get these results from these data.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum: https://forums.oracle.com/message/9362002
-
How to get the data to uppercase
Hi all
I have a table with 100 columns, all character only (varchar2) type. In the data that have already inserted with tiny...
Can here, my question is how I get all the data to uppercase only...
I'm trying as select upper (t.*) in tablename t; He is in error... no idea please help me...
Thanks and greetings
Stéphane
or you can create queries like this without having to type all of the columns;
Select 'select'. listagg ('upper('|| c.COLUMN_NAME||')) (',',') within the Group (order 1) |' from TABLENAME'
of dba_tab_cols c
where c.TABLE_NAME = 'TABLENAME '.
----
Ramin Hashimzade
-
How to get the dates of discontinuity
If there is discontinuity in dates how we write the query...
I need to get the dates and the dates of discontinuity.
I / p:
item_no first_date second_date
1 January 1, 10 Aug 1, 10
1-01 - 7.-10 1er January 11
1 February 1, 11 1 July 11
"
"
"
o/p:
1 1 January 10 01 - aug - 10
1 02-aug-10 (first_date + 1) 31-aug-10(second_date-1) - dates of discontinuity
1-01 - sep - 10 (second_date) 1st January 11
1 January 2, 11 January 31, 11
1 February 1, 11 1 July 11
'
'
'
Please let me know is possibleSQL> select * 2 from tbl 3 / ID FIRST_DAT SECOND_DA ---------- --------- --------- 1 01-JAN-10 01-AUG-10 1 01-SEP-10 01-JAN-11 1 01-FEB-11 01-JUL-11 SQL> with t1 as ( 2 select tbl.*, 3 lag(second_date) over(partition by id order by first_date) prev_second_date 4 from tbl 5 ), 6 t2 as ( 7 select * 8 from tbl 9 union all 10 select id, 11 prev_second_date + 1, 12 first_date - 1 13 from t1 14 where prev_second_date + 1 < first_date 15 ) 16 select * 17 from t2 18 order by id, 19 first_date 20 / ID FIRST_DAT SECOND_DA ---------- --------- --------- 1 01-JAN-10 01-AUG-10 1 02-AUG-10 31-AUG-10 1 01-SEP-10 01-JAN-11 1 02-JAN-11 31-JAN-11 1 01-FEB-11 01-JUL-11 SQL>
SY.
-
How to store historical data?
HIII,
I'll be very happy if someone resolve my issue?
I try to maintain historical data, I created a table using the materialized view, and every time I refreshed the table with new values, the old value should change to the history table and the current table should be updated with new values. I use oracle 10g. can someone tell how to do this.
Thankz in advance.981145 wrote:
I created a view, materialized with the name test.Simply create table history through copy of the table structure:
create history_table as select sysdate as date_backup, a.* from m_view a where 1=2
981145 wrote: I will update this materialized view once a month.
define a job with DBMS_SCHEDULER
981145 wrote:
When I refresh the test table should switch to test_hist and test the old values will be updated with new values.If work is started, it must copy all the data of m_view in the history table:
insert into history_table select sysdate, a.* from m_view a
and then call the dbms_mview.refresh:
DBMS_MVIEW.REFRESH('M_VIEW', 'C'); --completely refresh
-
How to get the data center moref moref VM in c# using
Hi all
Could someone tell how to get managedobjectreference of data center using the VM moref? or any other easy way is? If anyone has examples of code in c# please share with me?
Thank you
Vijaya
You can get the data center in which the virtual machine resides by the following search:
VM Moref-> Parent (vmFolder)
Moref folder VM-> Parent (data center)
Parent of the virtual computer object will always be the vmFolder and the vmFolder object will always be a data center.
For more details on the model of article inventory of vSphere, take a look at this blog post - http://www.doublecloud.org/2010/03/vsphere-inventory-structure-deep-dive/
-
How to get the date - 7 days (week)
Hi all
I am beginner in Java and JSP
I'm JSP search form (VO) where I need to set a default value for the start_date - 7 days
OK I get this display today date but how to get that displays a date-7 days?
< %
DateFormat df = new SimpleDateFormat ("JJ. MM.yyyy");
Date date = new Date();
String default = 'StartDate =' + df.format (new Date());
% >
ID
Thank youSimple approach if you're not worried about leap years: -.
Date todayMinus7 = new Date(System.currentTimeMillis() - 7 * 24 * 60 * 60 * 1000);
Alternatively take a look at the GregorianCalendar class and the add() method.
-
How to get a date on different pages?
Hey everyone, I am working on a daily planner for the office and I have a script that automatically generates the dates but I Don t know how to get each of the dates on another page. I would appreciate if someone could help me get each date generated by the script on the next page of my 365 page document. The scrip is:
var month = ["Jan", "Feb", "Mar", "Apr", "Peut", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "December"];
var length = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var days = ["Sun", "Mon", "Tue", "Wed", "Game", "Fri", "Sam"];
Count = 0;
day = 0;
months = 0;
week = 5;
Str = "";
While (count < 365)
{
Count ++;
"days of Str += [weekday] +", "+ (day + 1) +" "+ month [month] +"\r ";
day ++;
If (day > = length [month])
{
day = 0;
months ++;
If (month > 11)
months = 0;
}
day of week = (day of the week + 1) % 7;
}
App.Selection [0] .silence = str;
Tanks!
Try this,
app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
app.activeDocument.zeroPoint = [0,0];
{with (App.activeDocument.viewPreferences)}
horizontalMeasurementUnits = MeasurementUnits.points;
verticalMeasurementUnits = MeasurementUnits.points;
rulerOrigin = RulerOrigin.pageOrigin;
}
var month = ["Jan", "Feb", "Mar", "Apr", "Peut", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "December"];
var length = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var days = ["Sun", "Mon", "Tue", "Wed", "Game", "Fri", "Sam"];
Count = 0;
day = 0;
months = 0;
week = 5;
Str = [];
While (count<>
{
Count ++;
"Str [count] = days [weekday] + ', ' + (day + 1) +" "+ month [month] +"\r ";
str1 = str.toString ();
day ++;
If (day > = length [month])
{
day = 0;
months ++;
If (month > 11)
months = 0;
}
day of week = (day of the week + 1) % 7;
}
for (i = 0; i<>
{
var myTextframe = document.pages [i].textFrames.add ({geometricBounds:[0,0,50,150]});})
myTextframe.insertionPoints [0] .silence = str [i + 1];
}
Vandy
-
How to get related data element repository products
How to get products of data element repository using droplets
Can help on this requirement.
Thanks in advance.Hi, in Jsp, you can use as below:
~ Abdelali
-
How to get the date in the format dd/mm/yyyy?
Hello
for this query:
> select to_date (to_char (sysdate), ' dd/mm/yyyy') of double;
I wanted to get a date in the format dd/mm/yyyy, but this query is not in the right format to date.
How to get it?Why you are converting a date (it's a date in your table, right) tank and back to a date. When you want to display a date a certain way, you use to_char and specify the mask format to display the date as to_char (sysdate, 'dd-mm-yyyy'). Internally, dates are stored as bytes 7, you use to_char only for display purposes.
Maybe you are looking for
-
my lap top says device not found Boot please install an operating system on your hard drive
I was on yahoo and page froze. I hit ctrl/alt/del and nothing happened. Then, I hit ctrl/esc. I now have a screen saying device not found Boot. Please install an operating system on your hard drive. hard drive (3FO) what hurts? It is a Compaq presari
-
Phone Book Access Profile on Maxx?
I just bought a Panasonic cordless phone that allows interface Bluetooth with cell phones. A lot of features and works well to connect up to two phones at home. My question is about power transfer my contact book from the cell phone on the wireless p
-
Windows 7: Windows Fax and Scan - can't get it to automatic backup to a network
We use Windows Fax and Scan (Version 6.1 Build 7601: Service Pack 1)-this is the version included with our client for 32-bit Windows 7 Enterprise OS I just installed a scanner in a sleep laboratory, scanner works perfectly. There are several sleep te
-
Graphic Windows Mail in signature does not
Windows Mail... The graph of the signature will not be displayed even after the backup in a Windows message htm file by following the instructions. It worked before, but now it does not work. Any suggestions? The square appears with the name of th
-
Hi, I just bought the package of photography for £8,57 but then realized that he had all the stuff I needed. Is there anyway that I can cancel it as soon as possible?