Comparison of values
Hello
I have this table:
Line | PK |
1 | 100 |
1 | 120 |
1 | 150 |
2 | 200 |
2 | 250 |
2 | 280 |
2 | 290 |
3 | 80 |
3 | 90 |
3 | 95 |
and I had to get this one:
Line | PK | pk_continues |
1 | 100 | 100 |
1 | 120 | 120 |
1 | 150 | 150 |
2 | 200 | 200 |
2 | 250 | 250 |
2 | 280 | 280 |
2 | 290 | 290 |
3 | 80 | 370 |
3 | 90 | 460 |
3 | 95 | 555 |
When the change of line and pk n + 1 is smaller that n I have the sum of n + 1 with n. in this example, when the line switch to 3, I see 80 is less than 290, then I mak a sum 80 + 290 = 370, etc...
The pk values could not be in descending order within a line, bc, they can be in descending order when the line change.
Thanks for your help.
Hello
This selection should give the desired output using offset and sum functions
SELECT the line, pk, DECODE(inc_sum,0,pk,sum_lag+inc_sum)
Of
(SELECT line, pk, sum_lag, lag_pk, SUM (DECODE(sum_lag,0,0,pk)) on inc_sum (partition ONLINE CDE by pk)
Of
(SELECT the line, pk, lag_pk, SUM (lag_pk) to the sum_lag (line BY partition)
Of
(SELECT line, pk, DECODE (SIGN (pk - lag (pk) more (order of line, pk)),-1, lag (pk) (order online, pk), 0) lag_pk)
FROM t1
)
)
);
Concerning
Salim
Tags: Database
Similar Questions
-
Comparison of values in an array
Hello
I have a table with 16 values, so I would like to compare the first 14 values (using the subset of table vi) table and when they are all at a distance from each other, start a clock.
Because we measure the temperature with each of these entries in this table, once and only once, they raise spending about 100 degrees Celsius, I would begin to compare the proximity between them. Once they are all within 20 degrees celsius, on the other, this timer should start. I have the timer setting, but miss me this comparison.
I'm really new to Labview, the only way I can think of right now, will extract each unique value, and then comparing them with each other within a while loop, but there must be a better way, right?
Thanks in advance!
(by the way, it's just a separate simulation I'm linking the actual program, which is why the table and some other stuff is different)
There we go!
Just pick up where he left in the case of false, and told to not start (or just reset) if the time was 0, which it would have been if the true case had never been moved before.
Only problem is now that the present (s) is not reset to its default value 0 after I press stop, but since this would only return to the top once and the program would shut down, then restarted another day, it will not be a problem. And a friendly warning to remember to write 0 on the control if it were to start again would also go a long way. Overall, I am satisfied.
Thanks for the help!
-
Obtaining and comparison of value SelectOneChoice
Hi all. Again and again I am facing problems. This time, my task is to SOC to value and compare it. Getting through this method:
{} public void statusValueChangeListener (ValueChangeEvent valueChangeEvent)
System.out.println (valueChangeEvent.getNewValue ()); }
It works great, no problems here. Some figures as '1', ' 2 ', ' 4' etc. appear in the console. But when I compare the selected value with any number of other, I get nothing. Comparison code is:
If (valueChangeEvent.getNewValue () == '5') {System.out.println ("true") ;}
Looks good to me, but doesn't show anything.
Then, how the value retrieved must be compared? What I did wrong?
valueChangeEvent.getNewValue () give you index value and you compare it with twine. or a cast to a string and then compare.
and use equalIgnoreCase for the string comparison.
-
Comparison of values of multipe line
Hello
How to compare several values of line of a subset...? I have a table as follows, if I S1 input then all students registered for the same course will be displayed, such as S3 and S4 of the table below. Can we make it scalable, i.e. for thousands of values?
STUDENT COURSE S1 C1 S1 C2 S1 C3 S2 C1 S2 C2 S3 C1 S3 C2 S3 C3 S4 C1 S4 C2 S4 C3 S5 C2 S5 C3 S5 C4
Thank youWITH Q1 AS ( select 'S1' AS STUDENT, 'C1' AS COURSE FROM DUAL UNION ALL select 'S1' AS STUDENT, 'C2' AS COURSE FROM DUAL UNION ALL select 'S1' AS STUDENT, 'C3' AS COURSE FROM DUAL UNION ALL select 'S2' AS STUDENT, 'C1' AS COURSE FROM DUAL UNION ALL select 'S2' AS STUDENT, 'C2' AS COURSE FROM DUAL UNION ALL select 'S3' AS STUDENT, 'C1' AS COURSE FROM DUAL UNION ALL select 'S3' AS STUDENT, 'C2' AS COURSE FROM DUAL UNION ALL select 'S3' AS STUDENT, 'C3' AS COURSE FROM DUAL UNION ALL select 'S4' AS STUDENT, 'C1' AS COURSE FROM DUAL UNION ALL select 'S4' AS STUDENT, 'C2' AS COURSE FROM DUAL UNION ALL select 'S4' AS STUDENT, 'C3' AS COURSE FROM DUAL UNION ALL select 'S5' AS STUDENT, 'C2' AS COURSE FROM DUAL UNION ALL select 'S5' AS STUDENT, 'C3' AS COURSE FROM DUAL UNION ALL select 'S5' AS STUDENT, 'C4' AS COURSE FROM DUAL ) SELECT * FROM Q1 A
HESHHi, Hesh,
If you were to do it manually, what would you? You could do a list of courses of the student to the target and to compare this list to a list similar to the other student.
Here's a way to do exactly the same thing in SQL:WITH got_course_list AS ( SELECT student , LISTAGG (course, ',') WITHIN GROUP (ORDER BY course) AS course_list FROM q1 GROUP BY student ) SELECT s.* -- or whatever you want FROM q1 s JOIN got_course_list c ON c.student = s.student JOIN got_course_list t ON t.course_list = c.course_list AND t.student != s.student -- if wanted WHERE t.student IN ('S1') ;
This only shows the target student results. If you want to display the target student, then remove the line with the comment "if wanted.
You can get the results for 2 or more students to target at the same time; put all their identification in the IN list, in the WHERE clause. You probably want to add t.student to the game in this business of results.
-
Comparison of value TimeStamp coloumn
Hi all
I m using oracle Database 10 g.
SELECT *.
IN s22 dwh.fact_page_performance
WHERE the s22.datetime BETWEEN to_timestamp (' 01/01/2007 10:13 ',' YYYY/MM/DD hh: mi ') AND to_timestamp (' 01/01/2010 10:13 ',' YYYY/MM/DD hh: mi ')
-> This query works properly and giving the data.
but in my requirement date and time values are coming as strings, and I need concatenate two strings and need to compare.so I wrote the application as follows: -.
SELECT *.
OF dwh.fact_page_performance a12
WHERE a12. DATETIME BETWEEN to_timestamp (TO_CHAR (To_Date (January 1, 2007 "," dd-mm-yyyy "")))
|| ' '
|| TO_CHAR('10:13'), ' DD-MM-YYYY HH: MI ")
AND to_timestamp (TO_CHAR (To_Date (January 1, 2010 "," dd-mm-yyyy "")))
|| ' '
|| TO_CHAR('11:00'), ' DD-MM-YYYY HH: MI ")
When the query is run it gives no error, but the data are not give.
Can someone please help to get the data.
Note:-J' wrote to_date before conversion to the to_text.i m get the date format to_date only. I mean generating the value of date of application as it self have to_date converter.
Thanks and greetings
Swetha.
Published by: user12087180 on October 20, 2009 07:14
Published by: user12087180 on October 20, 2009 07:17Can you convert back to a CHAR first?
Then add the time component.
And then convert them to the return date?Like this:
to_date( to_char( To_date('01/01/2009','DD/MM/YYYY'),'DD/MM/YYYY) ||'10:15') ,'DD/MM/YYYYHH24:MI')
-
Problem with comparison of input text
Hello people,
I tried searching for an answer to this question, but I did have a little chance to find something that actually fits the question.
I created three zones of text entry with the instance names: input001, input002 and input003.
The three boxes are used for a comparison of values of simple text for an exercise in question.
The entry text boxes have been entered restricted so that only the values A, B, C or D can be entered (representing the four possible answers).
I created a button and event listener and the following function.
function submitBtn001Click(evt:MouseEvent):void{ trace("input001 = "+input001.text+" input002 = "+input002.text+" input003 = "+input003.text); if(input001.text == "A" && input002.text == "D" && input003.text == "C"){ input001.type = "dynamic"; input002.type = "dynamic"; input003.type = "dynamic"; correct.alpha = 1; submit_btn.visible = false; }else if((input001.text !== "A" | input002.text !== "D" | input003.text !== "C") && tryAgain == 1){ tryAgain++; trace(tryAgain); submit_btn.visible = false; reset_btn.visible = true; incorrect_first_try.alpha = 100; }else if((input001.text !== "A" | input002.text !== "D" | input003.text !== "C") && tryAgain >= 2){ input001.type = "dynamic"; input002.type = "dynamic"; input003.type = "dynamic"; incorrect.alpha = 100; submit_btn.visible = false; } }
When I compile the SWF, I get the following error:
1067: constraint implied of a Boolean value to a number that is unrelated. The error is attributed to the combination of else-if statements. If I comment on the other if statements, the SWF compile without error and the code runs correctly, when I enter the correct answers in entry areas (A, D, C).
What I don't understand is why my comparisons of strings in the world if the statements are generating an error, or why this error would have something to do with Boolean or number, as I compare the string value of text entry boxes (input001.text, for example) with a string.
Thanks in advance for your help.
Use the OR operator logic (|) instead of the OR operator (|)
-
I'm a little worried that there could be some cases where this would not be out to true. If so, is there a better way to do it? Just noticed if min = value ucrrent to check he will say new min even if there isn't, so I count to do this. But I'm more concerned about the equal comparison between value for check and min
If you have any questions, why not ValueToCheck
(Sorry, not LV on this PC)
-
Purpose of "null is not null" and "null is null" statements
Hi all
Please can someone explain the purpose of these statements and what it means.
1 null is not null
2 null is null
(a) NULL should be treated in a special way in the comparisons - see values NULL SQL - IS NULL and IS NOT NULL or SQL ISNULL(), NVL(), IFNULL() and COALESCE() functions
(b) If you really clauses Null is not null or Null is null (meaning: the first is not a variable) it could replace "always wrong" and "always true"; Maybe in some test queries
-
Is it possible to add months on ore.date without ore.pull?
Example:
Version 1.4 of ore
> DATE <-ore.push (seq (also. Date("1999/1/1"), by = "3 month", length = 2)) [2]
> DATE
[1] "1999-04-01.
> class (DATE)
[1] "ore.date".
attr(,"package")
[1] "OREbase".
>
> NEW_DATE <-seq (DATE = '3 month', length = 2)
Error in seq.int (r1$ Lun, by =, length.out = length.out):
"provenance" should be finished
Currently the ore.datetime feature to perform aggregates and summaries, comparisons, extract values and constraints.
In order to modify the datetime object, you can shoot locally using ore.pull:
DATE<- ore.push(seq(as.date("1999/1/1"),="" by="3 months" ,="" length="">->
Date<->->
new_date<- seq(mydate,="" by="3 months" ,="" length="">->
NEW_DATE<->->
Class (NEW_DATE)
R > NEW_DATE
[1] "1999-04-01" "1999-07-01".
R > class (NEW_DATE)
[1] "ore.date".
attr(,"package")
[1] "OREbase".
I'll add an improvement to enable this feature for a future version of ore.
Sherry
-
Help with a complex calculation of Acrobat Javascript
I am trying to establish an if / then calculation for an Acrobat form and it is difficult.
The premise is that when a customer enters a quantity of 3 and checked a box indicating a different package type, then apply a different price.
I am trying to automate that in the area of totals.
The Qty fields are labels: pre1, pre2. ... pre6
Box is: pre_keg
Total amount: Texte28
the total cost is: pre_cost
field reg price is: pre_bottle_cost
field of different packaging: pre_keg_cost
Guidance on how to get this working? Must it be done differently?
There is not many or comparison of value, you have to test each value individually.
var nSubTotal = this.getField("Text28").value;
var bMember = this.getField("pre_keg").isBoxChecked (0);
If ((nSubTotal == 3 || nSubTotal == 6 || nSubTotal == 9) & (bMember)) event.value = nSubTotal * 66.6666667;
of other if(!bMember) nSubTotal = event.value * 75.
You might also want to round the value of the event as it is financial and amounts of finance Word calculations are not performed in mils.
-
How you format text expansion?
RoboHelp 8.0.2.208
I try to put some of my text expanding to include dashes and possibly the lists.
I can't find it in the help: indeed, cannot find the function of text expansion in aid either.
For example, I stick to this format:
Values: [target] [operation] [value]
Where:
[target] is used to select the part of the e-mail message to use in the comparison. Values: SUBJECT, FROM, to, BODY
[operation] is the operation to perform. Values: EQUALS, CONTAINS
[value] is the string to search for in the target using the operation. Since the semicolon functions as a rule
separator in this setting, no semicolons in your string should be expressed as two semicolons (-).IN THIS WAY:
Values: [target] [operation] [value]
Where:
[target] is used to select the part of the e-mail message to use in the comparison. Values: SUBJECT, FROM, to, BODY
[operation] is the operation to perform. Values: EQUALS, CONTAINS
[value] is the string to search for in the target using the operation. Since the semicolon functions as a rule
separator in this setting, no semicolons in your string should be expressed as two semicolons (-).Thank you.
Written in FL
I just want to point that "expansion text" is online in a paragraph and not much can be exception, fonts, color, size, etc..
"Drop text" develops in contrast to one or more paragraphs. Can the title of those paragraphs like normal text.
-
How do I know whether or not the instance is affected?
Hello
Automatic activity or screenflow how would I know if instance has been attributed to a participant or not?
Thank youHello
Please find the code below and make the necessary changes in it.
Write the following code in the workflow activity of automatic screen, but before that you must pass the instanceid as an argument to the screen flow.
In the process as well as screen brand flow layer an instance instanceid as Intvariable.
Make a variable instanceidArg of the argument as a Int in the process and screenflow layer and map accordingly so that it will take the instanceid of process layer to the layer of screen flow.Assign instanceid = id.number; in automatic business process layer but before the global interactive activity where you maped the screen flow.
Write the following code in the automatic screen workflow activity.
logMessage ("= instanceid =" + instanceid); InstanceID is the id of the instance that you had a layer of process.
ProcessService ps;
InstanceFilter instF = InstanceFilter();
ps.connectTo (url: Fuego.Server.directoryURL, user: "", password: " "); In the studio the username and password will be the same
logMessage ("Connected");instF.create(processService: ps);
SearchScope = instF.searchScope (participantScope: ParticipantScope.ALL, statusScope: StatusScope.ONLY_INPROCESS);is the id of the process where you want to know the id of participant assighed
instF.addAttributeTo (variable: VarDefinition.processid, comparator: Comparison.CONTAINS, value: "/" + "");
instF.addAttributeTo (variable: VarDefinition.INSTANCE_NUMBER, comparator: Comparison.IS, value: Int (instanceid));
Instances of [] Fuego.Papi.Instance = getInstancesByFilter (ps, filter: instF);{foreach (instance in instances)
logMessage ("Assigned?:" + instance.participantId.empty);
logMessage ("instance.participantId:" + instance.participantId);}
ps.disconnectFrom ();In the runtime if assigned?: true which means that the instance is not assigned or false means assigned.
Sidonie
-
PBL to retrieve all instances assigned to a participant
Hello
I have a requirement to print a series of work items in a single PDF file. I think I may have a solution, but faced with the PBL - any help appreciated. My solution is as follows...
* The participant will affect a number of work items by using bulk actions-> for me
* Use a Global call a screen flow interactive
* Screen flow activity includes PBL to retrieve all the work items that are assigned to the current user
Take all the necessary data from the work items and move into a generation of PDF as a printing element service.
Could someone please help with how I would recover all bodies assigned to the current user in PBL? I use Oracle BPM 10.3.
Thank you
Neil
Published by: user13297570 on July 2, 2010 09:32Neil - try something like this to get a list of instances assigned to the current participant:
busProcesses as BusinessProcess instanceFilter as InstanceFilter instance as Fuego.Papi.Instance processName as String = "/" + "
" connectTo(busProcesses, url : Fuego.Server.directoryURL, user : "", password : " ", process : processName) create instanceFilter using processService = busProcesses.processService instanceFilter.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS) addAttributeTo instanceFilter using variable = VarDefinition.PARTICIPANT_ID, comparator = Comparison.IS, value = Participant.id // list the instances for each inst in getInstancesByFilter(busProcesses, filter : instanceFilter) do end Dan
-
Check out the parent of child instance Instance in a Split n.
Hello
Anyone here know how to extract the instance parent (the one that is waiting to join) inside of an instance of child SplitN?
I have to control whenever other children (from the same splitn) arrived at the join and get information that these copies of approved in the parent instance. I thought to use a database to store this information and make the instance of child (i.e. not yet reached the join) get the information to the database... but first I'd rather use native resources (PAPI) instead. Is it possible to navigate from child instance in the parent instance and go get a few variables?
Thanks for any help
LuizHere's where I downloaded a 10g Oracle BPM project that does this: http://www.4shared.com/file/141374182/7d6009e7/SplitNLookAtParentInstance.html
Here's the logic within the Split-N (now called Mulitple in Oracle 10 g BPM) which examines the original instance variable data. Remove the statement "entry" before going into production. It has been added here for clarity.
bp as BusinessProcess instF as InstanceFilter = InstanceFilter() instances as Fuego.Papi.Instance[] instanceDescription as String parentCustomerName as String connectTo bp using url = Fuego.Server.directoryURL, user = "AUTOCLIENT", password = "P", process = "/" + processName logMessage "create filter" create(instF, processService : bp.processService) logMessage "set scope" instF.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS) logMessage "setting parent number" addAttributeTo instF using variable = VarDefinition.INSTANCE_NUMBER, comparator = Comparison.IS, value = id.number logMessage "getting instances" instances = getInstancesByFilter(bp, filter : instF) logMessage "loop through them" for each inst in instances do do logMessage "Found it: " + inst.id + " in activity: " + inst.activityId idFields as String[] idFields = fields(inst.id,"/") // is this the original instance? if idFields[3] = "0" then parentCustomerName = String(getVar(inst, var : "customerName")) end on e as Exception logMessage "Exception: ->" + e.message end end disconnectFrom bp prompt as String = "Parent's name is [" + parentCustomerName + "] Enter a name: " input prompt : customerName using title = "title", buttons = ["Ok", "Cancel"] returning selectedButton = selection
Hope this helps,
Dan -
Error during the reallocation of tasks
Instance of ' / Process_AssignTasks#Default-1.0/71/0' could not be retained in the activity "GetAllTasksAssignedToUser". Details:
Instance of ' / Process_AssignTasks#Default-1.0/71/0' could not be locked because participant "Server" is currently locking.
fuego.papi.exception.CannotLockInstanceException: Instance ' / Process_AssignTasks#Default-1.0/71/0' could not be locked because participant "Server" is currently locking.
at fuego.server.AbstractInstanceService.getLocked(AbstractInstanceService.java:127)
at fuego.server.execution.EngineExecutionContext.acquireCurrentInstance(EngineExecutionContext.java:1380)
at fuego.server.execution.EngineExecutionContext.preImmediateExecution(EngineExecutionContext.java:1256)
to fuego.server.execution.DefaultEngineExecution$ AtomicExecutionTA.runTransaction (DefaultEngineExecution.java:284)
at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:462)
at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:540)
at fuego.transaction.TransactionAction.start(TransactionAction.java:213)
at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:118)
at fuego.server.execution.DefaultEngineExecution.executeWithoutComponentImmediate(DefaultEngineExecution.java:193)
at fuego.server.execution.EngineExecution.executeWithoutComponentImmediate(EngineExecution.java:95)
at fuego.server.AbstractProcessBean.reassignInstanceToParticipant(AbstractProcessBean.java:3779)
at fuego.server.AbstractProcessBean.instancesReassignTo(AbstractProcessBean.java:1770)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (unknown Source)
at java.lang.reflect.Method.invoke (unknown Source)
at fuego.lang.JavaClass.invokeMethod(JavaClass.java:1477)
at fuego.lang.JavaObject.invoke(JavaObject.java:185)
at fuego.component.Message.process(Message.java:585)
at fuego.component.ExecutionThread.processMessage(ExecutionThread.java:759)
at fuego.component.ExecutionThread.processBatch(ExecutionThread.java:734)
at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:140)
at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:132)
at fuego.fengine.FEngineProcessBean.processBatch(FEngineProcessBean.java:257)
at fuego.component.ExecutionThread.work(ExecutionThread.java:818)
at fuego.component.ExecutionThread.run(ExecutionThread.java:397)
I use this code to assign the task to another user.
lProcessService as ProcessService
BP as BusinessProcess
instF as InstanceFilter = InstanceFilter()
instanceDescription have thong
connectTo bp
using url = Fuego.Server.directoryURL,
user = 'super,'
password = "super"
process = process.name
create instF
using processService = bp.processService
SearchScope = instF.searchScope (participantScope: ParticipantScope.ALL, statusScope: StatusScope.ONLY_INPROCESS)
addAttributeTo instF
using the variable = "payDate.
comparator = Comparison.IS,.
value = 'abc '.
forums such as [Fuego.Papi.Instance] = getInstancesByFilter (bp, filter: instF)
for each inst in case
logMessage, 'assignment of task to ANALYST... ". "
Inst reasign
using participant = "analyst."
endHello
Would it be possible to figure what activity the work item instance is sitting in the Interior of your process?
If your instance is located inside a subflow, a waiting Message, a join, a timer or automatic running incredibly long activity, you won't be able to reassign the work item instance. Only instances located inside Interactive activities or decision can be reallocated.
Hope this helps,
Dan
Maybe you are looking for
-
laptop has vertical along the center of the screen. How can I fix it?
On the laptop screen, a white vertiical line came in the middle of the screen. Don't know how to get rid of this line.
-
HP pavilion dv7 will not start
my hp dv7 prodcut id xh116ua #abc fails to start. Boot starts and also gets a flashing with windows start logo then the screen goes black and nothing happens Advanced sys diag worm 3.7.0.0 result is drive hard failure id Q32F8M - 59L 777 - XD002K -
-
Classic BlackBerry classic BB... .battery associated
I bought my classic BB about 6 to 8 weeks; When the battery drops below 20% I put it on the charger provided to BB until it shows responsible compledely. Often then let stand all night while I'll see where the battery began to drip down? I keep th
-
I was not able to use the brush that erases or hair exposes all refine RADIUS tool. I get to this 'circle with a slash' all the time.Anyone know what I can do to properly use gum and expose them to refine tool?
-
Zur citizens input Seriennummer nach operating system upgrade (Windows 10)
Hallo.Habe ICH in diesem Forum noch kein adaquate question und Antwort found.I have Creative Suite Production Premium seit 5.5 Sommer 2011. Prima lief auf Windows 7 64 bit.Nun habe ich das auf Windows 10 security upgrade.Wenn ich nun meine Creative S