Help with necessary multiple selections
Hi all
I've used this forum where they gave me an answer to my question (Thanks Paul). My question now is:
I have a drop down list with script behind it that makes a visible text field:
If (xfa.event.newText == "Vacancy)."
Form1. SBF00.position1.presence = "visible";
Another Form1. SBF00.position1.presence = 'hidden ';
The question I have now, it's more of an entry in the drop-down list required the text field becomes visible. I tried this:
(First line on the form)
If (xfa.event.newText == "Vacancy") Gold
(xfa.event.newText == "Sickness") Gold
(xfa.event.newText is "Annual leave")
Form1. SBF00.position1.presence = "visible";
Another Form1. SBF00.position1.presence = 'hidden ';
((Deuxième ligne dans formulaire)
If (xfa.event.newText == "Vacancy") Gold
(xfa.event.newText == "Sickness") Gold
(xfa.event.newText is "Annual leave")
Form1. SBF00.position2.presence = "visible";
Another Form1. SBF00.position2.presence = 'hidden ';
I have the updated form in place with several lines that the end user can move down if they need more than one entry. It sort of works but if I choose for example illness, the next box down (position2) does not display text box visible if I choose, for example, "vacancy."
Thank you all.
Heavy E
Try this:
If ((xfa.event.newText == "Congés annuels") |) (xfa.event.newText is "Disease")) {
XFA. Form.Form1.BodyPage1.position1.Presence = 'visible' ;}
else {xfa.form.form1.BodyPage1.position1.presence = "hidden" ;}
Tags: Adobe LiveCycle
Similar Questions
-
Help with master / multiple details from the collections
Hello
I am trying to create multiple details for my master report using collections by the method of Blarman on https://community.oracle.com/thread/1091458. This is my first shot of dagger to collections and I seem to be missing something, but for the life of me, I don't know what. I managed to get the display of collection for the captain, but when this inserts / updates, only the first collection seq_id is already updated or inserted the user entry. I suspect that I'm doing something stupid on BCM_POPULATE_TICKET_REF_COL to avoid updates to all items in the collection, but after much research and trying, I do not know what. Any suggestions would be much appreciated.
Thank you!
Michelle1. structure of the table
CREATE THE TABLE DBSCH1. BCM_FINDINGS
(
NUMBER OF FINDINGS_ID
VARCHAR2 (200 BYTE) WORKING GROUP,
VARCHAR2 (200 BYTE) TEAM.
DIVISION VARCHAR2 (200 BYTE),
RAISED_BY VARCHAR2 (200 BYTE),
...
)CREATE THE TABLE DBSCH1. BCM_COMMENTS
(
NUMBER OF COMMENTS_ID
COMMENTS VARCHAR2 (4000 BYTE),
FINDINGS_ID NUMBER NOT NULL
)CREATE THE TABLE DBSCH1. BCM_TICKET_REF
(
NUMBER OF TICKET_REF_ID
TOOL VARCHAR2 (4000 BYTE),
TICKET_REF VARCHAR2 (4000 BYTE),
LINK VARCHAR2 (4000 BYTE),
FINDINGS_ID NUMBER NOT NULL
)
2 created master / detail report on BCM_FINDINGS & BCM_COMMENTS.3. create the BCM_TICKET_REF collection:
CREATE or REPLACE PROCEDURE BCM_CREATE_TICKET_REF_COL (full bcm_findings_id)
as
I have pls_integer;
CNTR pls_integer: = 5;
Start
apex_collection.create_or_truncate_collection ('POPULATE_TICKET_REF_COL');
for Rec in)
Select the tool, ticket_ref, link, ticket_ref_id, findings_id
of bcm_ticket_ref
where FINDINGS_ID = bcm_findings_id)
loop
() apex_collection.add_member
p_collection_name = > 'POPULATE_TICKET_REF_COL ',.
p_c030 = > Rec.ticket_ref_id,--primary key
p_c031 = > Rec.tool, - placeholder text
p_c032 = > Rec.ticket_ref, - placeholder text
p_c033 = > Rec.link, - placeholder text
p_c034 = > Rec.findings_id fk - space
);
end loop;
because me in 1.cntr
loop
() apex_collection.add_member
p_collection_name = > 'POPULATE_TICKET_REF_COL ',.
p_c030 = > 0, - designates this as a new registration
p_c031 = > NULL,-placeholder text
p_c032 = > NULL,-placeholder text
p_c033 = > NULL,-placeholder text
p_c034 = > bcm_findings_id - number placeholder
);
end loop;
end BCM_CREATE_TICKET_REF_COL;
Support - before the header:BEGIN
BCM_CREATE_TICKET_REF_COL (bcm_findings_id = >: P2_FINDINGS_ID);
END;
4. definition of standard report for BCM_TICKET_REF region:
SELECT rownum,
apex_item. Hidden (30, c030), - ticket_ref_id
apex_item. Text (31, c031, 20, 20) tool.
apex_item. Text (32, c032, 15, 15) ticket_ref,.
apex_item. Text (33, c033, 15, 15) link.
apex_item. Hidden (34, c034) findings_id
OF APEX_COLLECTIONS
WHERE COLLECTION_NAME = "POPULATE_TICKET_REF_COL."5. get user input for the update of the collection BCM_TICKET_REF
CREATE OR REPLACE PROCEDURE BCM_POPULATE_TICKET_REF_COL
AS
j pls_integer: = 0;
Start
for j1 in)
Select seq_id apex_collections
where collection_name = "POPULATE_TICKET_REF_COL."
the order of seq_id loop)
j: = j + 1;
-(number) ticket_ref_id
apex_collection.update_member_attribute (p_collection_name = > 'POPULATE_TICKET_REF_COL',)
p_seq = > j1.seq_id, p_attr_number = 30, p_attr_value = > wwv_flow.g_f30 (j));
-tool (text)
apex_collection.update_member_attribute (p_collection_name = > 'POPULATE_TICKET_REF_COL',)
p_seq = > j1.seq_id p_attr_number = > 31, p_attr_value = > wwv_flow.g_f31 (j));
-ticket_ref (text)
apex_collection.update_member_attribute (p_collection_name = > 'POPULATE_TICKET_REF_COL',)
p_seq = > j1.seq_id p_attr_number = > 32, p_attr_value = > wwv_flow.g_f32 (j));
-link (text)
apex_collection.update_member_attribute (p_collection_name = > 'POPULATE_TICKET_REF_COL',)
p_seq = > j1.seq_id p_attr_number = > 33, p_attr_value = > wwv_flow.g_f33 (j));
-(number) findings_id
apex_collection.update_member_attribute (p_collection_name = > 'POPULATE_TICKET_REF_COL',)
p_seq = > j1.seq_id p_attr_number = > 34, p_attr_value = > wwv_flow.g_f34 (j));
apex_application.g_print_success_message: = "loop COUNTER" | j;
end loop;
end;On present - before the calculations and validations
BEGIN
BCM_POPULATE_TICKET_REF_COL;
END;
6 update DB with the data in the collection BCM_TICKET_REF
CREATE OR REPLACE PROCEDURE DBSCH1. BCM_UPDATE_TICKET_REF
AS
j pls_integer: = 0;
Start
-Obtaining records from Collection
for y in (select TO_NUMBER (c030) ticket_ref_id,
C031 tool,
C032 ticket_ref,
C033 link,
TO_NUMBER (c034) findings_id
OF APEX_COLLECTIONS
WHERE collection_name = "POPULATE_TICKET_REF_COL") loop
j: = j + 1;
If y.ticket_ref_id = 0 then - new record
insert into BCM_TICKET_REF (ticket_ref_id, tool, ticket_ref, link, findings_id)
values (BCM_TICKET_REF_SEQ.nextval, y.tool, y.ticket_ref, y.link, y.findings_id);
APEX_DEBUG. MESSAGE (p_message = > 'INSERT the LOOP COUNTER': j);
"exit";
elsif y.ticket_ref_id > 0 then - existing record
Update BCM_TICKET_REF
adjustment tool = y.tool,
ticket_ref = y.ticket_ref,
link = y.link,
findings_id = y.findings_id
where ticket_ref_id = y.ticket_ref_id;
APEX_DEBUG. MESSAGE (p_message = > 'UPDATE the LOOP COUNTER': j);
"exit";
on the other
APEX_DEBUG. MESSAGE (p_message = > "NUTHIN'");
"exit";
end if;
end loop;
end;Present on - after calculations and validations
BEGIN
BCM_UPDATE_TICKET_REF;
END;HA! Well it took me several tries, but I finally saw him, you have a 'out' right after insertion (and updated). That could leave the loop and record #2 would never happen.
Just remove it. In your case you are inserting/updating all your lines.
-Jorge
-
I have Windows 7 pro on my Dell laptop. I have Essitials of Microsoft security running. I need to know how I can get to allow Java to run thru and install correctly. I need Java to run for some real estate Web sites.
http://Java.com/en/download/index.jsp
You can download and install from there. If that does not work, after back and let know us what error it gives you (as applicable), and we will help you from there. -
Query output to multiple selection data
I am trying to output the name of the person and the Organization to which they belong. A user can belong to more than one org and org may have multiple users associated with them.
I have a table of user with user_id, username_txt, password_txt user_org_id fields
a table of org that has org_id and org_cd
a user_org table that has a user_org_id, user_id and org_id
This is how I create the relationship between users and organizations.
I'm trying out the name of a person and a multiple selection box that has all the orgs that is assigned to a user selected. but the form is to select only a single organization. How can ensure me that the selection box shows the user orgs selected?
I think I have to do some kind of loop or something else to get all values - I don't know what to do. any help would be appreciated. Thank you!
See my code:With the help of a multiple selection with pre-selected items makes it very easy for users accidentally deselect things.
But, if you insist, change this:
SELECTED
to do this:
selected = "selected". -
Need to field multiple select the option without having previously selected deleted
Hi all
Request Express 4.1.1.00.23
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
I have a requirement of adding a field of multiple selection to a single screen, and I added the list to multiple selection, without a second thought. Of course, the question is when a user tries to edit a record, click on (with the CTRL key) two options in the selection list multiple, but not clicked on those previously selected, then we lost them. Then I thought to create checkboxes and thus those already selected will be always checked when try to update.
But I want to do with the multiple selection field. So I was wondering if there is a way?
Thank you!
Sam82 wrote:
Request Express 4.1.1.00.23
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
I have a requirement of adding a field of multiple selection to a single screen, and I added the list to multiple selection, without a second thought. Of course, the question is when a user tries to edit a record, click on (with the CTRL key) two options in the selection list multiple, but not clicked on those previously selected, then we lost them. Then I thought to create checkboxes and thus those already selected will be always checked when try to update.
But I want to do with the multiple selection field. So I was wondering if there is a way?
This is the behavior expected multiple-selection list. It can be changed using a point hidden shadow and JavaScript, but there is no way out of the box to achieve what you propose.
Selections several lists are usually a bad idea:
- Users do not know how they work
- They are confused and source of errors, except if all options are visible (which generally wastes space UI)
- The resulting values of treatment is problematic
- They are often the cause of a model of incorrect data or result
Checkboxes or a shuttle are much better options and controls for multiple choice options.
-
Multiple selection works only not active based on
Hello
I tried to create an asset base with a multiple selection, but it strives to 7.6, but not in 11g. Not able to select multiple values from the drop down.
The default tag is not is also reflected. Here is the code I use.
< NAME of ASSET = 'Changes' DESCRIPTION = 'Changes' MARKERTEXT = "' * ' PROCESSOR ="5.0"DEFDIR =" / apps/shared/storage/ChangeSet_Test1 ' RENDERUSINGTEMPLATE = 'no' > "
PROPERTIES of <>
< PROPERTY NAME = "AssetTypes" DESCRIPTION = "AssetTypes" >
< STORAGE TYPE = "VARCHAR" LENGTH = "30" / >
< TYPE INPUTFORM = "SELECT" MULTIPLE= 'YES' SOURCETYPE = "STRING" VALUES = "Left, Right and Center" DEFAULT= "" OPTIONDESCRIPTIONS = "Left, centered, right" / > "
< SEARCHFORM DESCRIPTION = "AssetTypes updated / created" TYPE = "SELECT" SOURCETYPE = "STRING" VALUES = "Left, Right and Center" OPTIONDESCRIPTIONS = "Left, centered, right" / >
< / PROPERTY >
< / PROPERTIES >
< / ASSETS >
Concerning
Bishnu
Hello BishnuSatpathy,
This is a known bug prior 11.1.1.8 patch 4.
For more information, please see note 1587776.1
I suggest that you upgrade your version to 11.1.1.8 patch 5 to solve this problem, or you can also try the workaround mentioned in the note
1 - Open the [PATH_TO_SHARED_FOLDER]/elements/OpenMarket/AssetMaker/BuildEditSelect.xml file
2. remove the dojoType = "the attribute fw.dijit.UISimpleSelect" lines 67 and 115 "
3 - restart the application.
4. multiple items can be selected after you make this change.
BTW, do not forget to add SIZE = "4" in the INPUTFORM, otherwise you get a narrow selection box.
Concerning
David
-
Help with POST data if multiple selections are chosen
I created a form with a menu (list) which includes all 50 States. I used the MESSAGE option, as well as PHP, to treat form data, which will be sent to me. The list menu looks like this: http://askdave.info/help/states_menu.gif and I have "Allow multiple selections" checked in the property inspector.
If the user chooses several States, I want EACH of these States to be included in the email that I receive. Right now, if I check several States, I get only the latest state selected. For example, here is the email that I get after I check 5 different States. http://askdave.info/help/FormData.gif
Problem-> in this email, only one State is indicated (Hawaii), even if I selected 5 different States. How can I get the data from the form to list all THE States that are checked?
Here's what I have:
< form name = "form1" method = "post" action = "process.php" >
< input type = "hidden" name = "required" value = "name, phone, email, States, capital" / >
And then for the menu that lists the States, I have:
< label >
< select name = 'States' size = '7' several id = 'States' >
all States < option > < / option >
Alabama < option > < / option >
Alaska < option > < / option >
Arizona < option > < / option >
Arkansas < option > < / option >
and so on...
What Miss me? How can I get the PHP script to send multiple values, if multiple values are selected? (I'm new to PHP, so go easy on me.) I can post my code, if necessary.) Is this a PHP problem, or do I have to add something to the HTML form?Hello
>>
I think that DynaForm is synonymous with dynamic form
>>This makes some sense ;-) I was wondering just because there is a pre-made script called DynaForm here, but it has a different 'Logistics' than yours.
However, both "DynaForm" versions are pretty basic, because they deal only with non-multiple values - fields as a single line, texareas and select´s non-multiple of form input fields. Your script for example just loops through all the existing form fields using the method "foreach":
Out of form fields and values.
foreach ($this-> post as $field-online $value) {/ / loop through all form fields}
If ($field == "required") continue;
$this-> _addLine ($field, $value); Here´s where the field´s name/value consolidation happens
}.. .and simply includes a 'value' with his 'name' associated field´s. The problem is: this method works, simply to have only 1 value - but any 'multiple value' form fields (for example your 'States' select or check box groups who spend several values as well) require a separate "foreach" in the script treatment, fields and this hasn´t been incorporated here.
That said, I would suggest using another solution pre-made as PHP Form Mail script that s capable of managing your multiple values - scenario naturally.
-
Settlement data based on multiple selection ListBox reference need help
Hello again,
The question that I have is selecting from a listbox with multiple selection to fill the tables with the selected data. My code is as follows:
Void loadData_EventClick (ByRef This)
Dim j
Dim k
k = 0
If ListBox.MultiSelection.Count = 0 Then Exit Sub
For j = 1 To ListBox.Items.Count
If ListBox.MultiSelection (j). Count = True Then
k = k + 1
End If
Next
TextBox.Text = k
End Sub
The code works perfectly up to the second if statement. My current channel group list contains 16 channels and with the second if statement guided the textbox output is equal to 16 (i.e. k = 16), which is what I expected. Im just using the k = k + 1 for the test. Eventually will be replaced by operating code specific to what I need to do.
So the question that I have is to get the code to recognize what values are selected and referring to the index for the selections in a table. Im not sure on how to do it.
Any help is very appreciated.
Thank you
~ Nathan
Attached JPEG shows the current user interface and the output of k with the second if statement commented
Hey Nathan--
ListBox.MultiSelection () is a function that returns an array of [multiple] selected items in ListBox.
ListBox.MultiSelection.Count is a property that returns the number of items in the table above.
Therefore, the logic in your second IF statement that says if ListBox.MultiSelection (j). Count = True really makes no sense because:
- The array returned by the multiple selection (using (j) indexing now refers to a single selected item in the list (which has not its own 'Count' property)
- If you don't the array index, assuming that you had selected 4 items in your list, your statement would still be actually as said if 4 = True which is not what you get.
Make sense?
Here is a modified version of your code that I hope makes it a little more obvious how these elements relate to one another. Give it a run; of course, 75% of the code is extranneous to you working end to account, so make sure that you subsequently delete what you won't need.
Sub loadData_EventClick (ByRef This) ' creates the event handler
Dim j
If ListBox.MultiSelection.Count = 0 Then Exit Sub
TextBox.Text = "Total ListBox items:" & ListBox.Items.Count & + "" \n "".
TextBox.Text = TextBox.Text & "Total selected items:" & ListBox.MultiSelection.Count & + "" \n "".
TextBox.Text = TextBox.Text & "Selected Items:" & + "\n"
For j = 1 to ListBox.MultiSelection.Count
TextBox.Text is TextBox.Text & ListBox.MultiSelection (j). Text & ", index" & ListBox.MultiSelection (j). Index & + "\n"
Next
End SubYou are making great progress; It will get quickly easily faster and we are here to help – do not hesitate.
-
Problem Manager multiple selection with system dialog box
I currently have a problem with the help of system on a manager of multiple selection dialog as the code below works fine:
multiSelectHandler { status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged actions: [ DeleteActionItem { id: deleteActionItem onTriggered: { var selectionList = listView1.selectionList(); var selectedItem = dataModel.data(selectionList); console.log(selectedItem); for (var i = 0; i < selectionList.length; ++ i) { _sql.deleteClient(dataModel.data(selectionList[i]).clientID) dataSource.loadData() } } } ] }
However, when it is changed to use that a dialogue system, the feature does not work and the console record results:
selected list: undefined
selected item: undefined
multiSelectHandler { status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged actions: [ DeleteActionItem { id: deleteActionItem onTriggered: { multiSelectDeleteDialog.show() } attachedObjects: [ SystemDialog { id: multiSelectDeleteDialog title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged onFinished: { if (result == 3) { console.log("Cancelled") } else { console.log("Deleted") var selectionList = listView1.selectionList() console.log("selected list: " + selectionList) var selectedItem = dataModel.data(selectionList); console.log("selected item: " + selectedItem); for (var i = 0; i < selectionList.length; ++ i) { _sql.deleteClient(dataModel.data(selectionList[i]).clientID) dataSource.loadData() } } } } ] } ] }
With the help of Roger Leblanc, it works now
multiSelectHandler { status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged actions: [ DeleteActionItem { property variant selectionList property variant selectedItem id: deleteActionItem onTriggered: { deleteActionItem.selectionList = listView1.selectionList() deleteActionItem.selectedItem = dataModel.data(selectionList); multiSelectDeleteDialog.show() } attachedObjects: [ SystemDialog { id: multiSelectDeleteDialog title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged onFinished: { if (result == 3) { console.log("Cancelled") } else { console.log("Deleted") for (var i = 0; i < deleteActionItem.selectionList.length; ++ i) { _sql.deleteClient(dataModel.data(deleteActionItem.selectionList[i]).clientID) dataSource.loadData() } } } } ] } ] }
-
Multiple selection with binding variable error
Hello world
I tried to put in place an array of adf multiple selection with another table, by following the tutorial (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/75-multi-parent-row-detail-views-328078.pdf), page 3.
I created all things and first of all I had an exception error, which I fixed, but now, whenever I try to select multiple lines, it won't update the table of the adf.
In this example, I choose a service line and it shows the emplooyes, but every time I try to choose another line by ctrl clicking on it, the employees table be updated.
Since I tryied to follow the tutorial, I'll put the code for the bean, I created for this purpose (it's a little different than the code given by the tutorial, but only because I had to get rid of the exception error)
I use jdeveloper Studio Edition Version 12.1.2.0.0.
Here is my code for the bean.java:
Select listen port defined for the departments table. The selected line keys are read in the reference table.
For each line, the Department ID value is read and added to a string buffer that generates a comma-delimited
List of the departmentIds. In the end, this string is passed as an argument to the link of action ExecuteWithParams
{} public void onDepartmentTableSelect (SelectionEvent selectionEvent)
variable to hold the string containing the selected set value line departmentId
StringBuffer departmentIds = new StringBuffer();
Go to the main table to read selected line keys
RicheTableau rt = selectionEvent.getSource ((richeTableau));
RKS RowKeySet = rt.getSelectedRowKeys ();
Iterator selectedRowsIterator = rks.iterator ();
memorize the current line to place it back in the end key
CurrentRowKey () rt.getRowKey = (list);
for each selected master line, determine the departmentId
int size = 0;
{while (selectedRowsIterator.hasNext ())}
size ++;
The rowKey () selectedRowsIterator.next = (list);
each value is terminated by a comma
If (departmentIds.length () > 0) {}
departmentIds.append(",");
}
take the current line
rt.setRowKey (rowKey);
JUCtrlHierNodeBinding wrappedRow = rt.getRowData ((JUCtrlHierNodeBinding));
Line rw = wrappedRow.getRow ();
/*
Number departmentId = (number) rw.getAttribute ("DepartmentId");
*/
int departmentIdInt = rw.getAttribute ("DepartmentId") (Integer);
oracle.jbo.domain.Number departmentId = new oracle.jbo.domain.Number (departmentIdInt);
departmentIds.append (departmentId.stringValue ());
}
back the foreign currency on the line
rt.setRowKey (currentRowKey);
Run the query on the detail table
BindingContext bctx = BindingContext.getCurrent ();
BindingContainer links = bctx.getCurrentBindingsEntry ();
OperationBinding executeWithParams = bindings.getOperationBinding("ExecuteWithParams");
executeWithParams.getParamsMap () .put ("departmentIds", departmentIds.toString ());
executeWithParams.execute ();
refresh the detail table
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance ();
adfFacesContext.addPartialTarget (employeeTable);
}
}
If someone has an idea of why it isn't updated table, please answer. Any idea can help.
Thanks in advance.
Greetings,
Frederico Barracha.
Finally, I found the problem...
The problem was that I had to remove a line in the properties of my table, the property services: selectedrowkeys, because he only spent the last selected row.
Yet, I apreciate the help and I had to replace a code in the bean.java, in reason of the exception error and you had to do. Maybe I did a configuration in the wrong way and he would not.
Thanks for the help.
Kind regards
Frederico.
-
Multiple selection with Variable presentation
Hello gurus:
I currently have a dashboard where the user selects a Promotion ID and all other reports are based on this promo-id.
Now, I use variable presentation for the promo-id.
Now obligation if, for another page of dashboad, where a user can select up to 4 different promo-ID and compare them from the same measures.
I was thinking about using PivotTable dynamic to compare and multiselect selection of promotions up to 4 guest.
However I do not think that variable presentation works with multiple selection prompt.
So, what should I do about it?
I can do 4 different guests, but then it will force the user to select 4 promotions every time. I want to do something where the user can select 2,3 or 4 promotions.
Please help me.
Thank you.
~ Vinay.Yes, if you use the same column to create the dashboard and to create the filter.
-
Help with the query to select only one record from the result set in double
Hello
Please help with the query. Version of Oracle database we use is 10g R2.
I have a vision that is duplicated IDS, but they are used across the different functions. See below examples of data. Please help me with a query to select only one record (based on ID regardless of the area) from the bottom of the result set of duplicate records. For what is the point of view is there unique records, given the combination of the fields ID, Org, DF, dry, Sub-Sec
ID Org DF Sec Sub-Sec (163) CQ CPDM CPDM HD (163) PC ENG ENG ENG (163) CQ ASIC ASIC IS 8888 TS TAC TAC TAC (163) TS HE HE SW 6789 CQ INFO INFO FOS 6789 PC SECSYS SECSYS INFO1 6789 TS SECSYS SECSYS INFO2 9009 PC BMS BMS BMS1 My result set must eliminate the duplicate identifiers regardless of whoever we choose of the result set. (I mean without distinction Org, DF, s, Sub-s). My expected result set should be.
ID DSB DF SEC Sub-Sec (163) CQ CPDM CPDM HD 8888 TS TAC TAC TAC 6789 CQ INFO INFO FOS 9009 PC BMS BMS BMS1 Thank you
Orton
Hello
This sounds like a job for ROW_NUMBER:
WITH got_r_num AS
(
SELECT id, DSB, df, s, sub_sec org
ROW_NUMBER () OVER (PARTITION BY ID.
ORDER BY org
) AS r_num
OF view_x
)
SELECT id, DSB, df, sub_sec s,
OF got_r_num
WHERE r_num = 1
;
He is a Top - N query example, where you choose the elements of N (N = 1 in this case) from the top of an ordered list.
I hope that answers your question.
If not, post a small example of data (CREATE TABLE and INSERT, only relevant columns instructions) to your sample data and the results desired from these data. (I know that you said that you were a view selection. Just for this thread, pretending it is a picture and post simple CREATE TABLE and INSERT statements to simulate your point of view).
Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places. (I didn't quite understand the explanation above. I don't know why you want toID ORG DF DRY SUB_SEC
-- --- -- --- -------
1234 CQ DPRK DPRK HD
and is not
1234 IS CQ ASIC, ASIC
or
TS 1234 IT IT SW
or
1234 CQ ASIC ASIC HD
)
If you change the query at all, post your modified version.
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
-
Help line with MAX Date selection
The data returned by my query currently looks like this.
10 100 A 29 FEBRUARY 12
11 101 OCTOBER 16, 12 B
12 102 B 5 DECEMBER 12
13 103 C 23 JANUARY 13
When the data in the third column is duplicated, I want to only return the line with the most recent date in the 4th column (in this case row 3).
So what I really want is the following.
10 100 A 29 FEBRUARY 12
12 102 B 5 DECEMBER 12
13 103 C 23 JANUARY 13
Any help would be greatly appreciated.Thank you
Mark
Here's a way...
SQL > ed
A written file afiedt.buf1 with t as (select 10 as the id, 100 such as seq, 'A' as the grp, date '' 2012-02-29 as dt of union double all the)
2. Select 11, 101, 'B', date '' 2012-10-16 of all the double union
3. Select 12, 102, 'B', date '' 2012-12-05 Union double all the
4. Select 13, 103, 'C', date "double ' 2013-01-23)
5 --
6 select max (id) keep (dense_rank of the first order by dt desc) as id
7, max (seq) keep (dense_rank of the first order by dt desc) as seq
8, grp
9, max (dt)
10 t
11 * grp group
SQL > /.ID SEQ G MAX (DT)
---------- ---------- - --------------------
10 100 WAS FEBRUARY 29, 2012 00:00:00
12 102 B 5 DECEMBER 2012 00:00:00
13 103 C 23 JANUARY 2013 00:00:00 -
Help with SELECT - select the range of numbers
Hello
I need assistance with the SELECT statement. I want to choose Dates today and ending 30 days back. If the result would be like:
I was thinking about truncated SYSDATE simply select in the first column and second column number 0, 1, 2... 30 then I'd just do a difference first column - second. But how to choose such sequence of numbers? I don't want to choose every number (date) in the select distinct statement, then Union them.TRUNC(SYSDATE) TRUNC(SYSDATE) - 1 TRUNC(SYSDATE) - 2 TRUNC(SYSDATE) - 3 . . . TRUNC(SYSDATE) - 30
Does anyone have an idea?
Thanks for the help, DanSQL> select trunc(sysdate) - level + 1 as dt 2 from dual 3 connect by level <= 31 4 ; DT ----------- 07/01/2013 06/01/2013 05/01/2013 04/01/2013 03/01/2013 02/01/2013 01/01/2013 31/12/2012 30/12/2012 29/12/2012 28/12/2012 27/12/2012 26/12/2012 25/12/2012 24/12/2012 23/12/2012 22/12/2012 21/12/2012 20/12/2012 19/12/2012 DT ----------- 18/12/2012 17/12/2012 16/12/2012 15/12/2012 14/12/2012 13/12/2012 12/12/2012 11/12/2012 10/12/2012 09/12/2012 08/12/2012 31 rows selected
-
Hello
could you please help write select sql to retrieve the maximum number of concurrent users, something to check?
user_id, rec_start, rec_end
1, 01.10.2009 12:01, 01.10.2009 13:11
2, 01.10.2009 13:12, 01.10.2009 14:04
3, 01.10.2009 13:35, 01.10.2009 13:55
1, 01.10.2009 14:35, 01.10.2009 14:50
1, 01.10.2009 14:45, 01.10.2009 14:50
I would like:
hour, max_of_conc_users
01.10.2009 12: 1 - no more then 1 user at the same time
01.10.2009 13: 2 - user_id 2and 3 record at the same time
01.10.2009 14: 2 - user_id 1 to 2 sessions
Thank you
D.Hello
Interesting problem!
We will change a bit, your sample data for the (total connections per hour) much simpler problem solved by Sven and Hoek has not coincidentally the same results as your problem (the high concurrent users per hour).
I changed the data of Hoek, adding a line, which has been lgged in for the entire period covered by others:CREATE TABLE t as select 9 user_id, to_date('01.10.2009 12:01', 'dd.mm.yyyy hh24:mi') rec_start, to_date('01.10.2009 14:49', 'dd.mm.yyyy hh24:mi') rec_end from dual union all select 1 user_id, to_date('01.10.2009 12:01', 'dd.mm.yyyy hh24:mi') rec_start, to_date('01.10.2009 13:11', 'dd.mm.yyyy hh24:mi') rec_end from dual union all select 2, to_date('01.10.2009 13:12', 'dd.mm.yyyy hh24:mi'), to_date('01.10.2009 14:04', 'dd.mm.yyyy hh24:mi') from dual union all select 3, to_date('01.10.2009 13:35', 'dd.mm.yyyy hh24:mi'), to_date('01.10.2009 13:55', 'dd.mm.yyyy hh24:mi') from dual union all select 1, to_date('01.10.2009 14:35', 'dd.mm.yyyy hh24:mi'), to_date('01.10.2009 14:50', 'dd.mm.yyyy hh24:mi') from dual union all select 1, to_date('01.10.2009 14:45', 'dd.mm.yyyy hh24:mi'), to_date('01.10.2009 14:50', 'dd.mm.yyyy hh24:mi') from dual ;
The query below unpivots these data in separate lines for rec_start and rec_end. We use the analytical SUM function to count each + 1 rec_start and each rec_end as -1 to get the number of concurrent users at any time. As soon as we have these data, we can use GROUP BY TRUNC (dt, 'HH')as Sven Hoek has suggested, to get the maximum by houir:
WITH cntr AS ( SELECT 1 AS cnt FROM dual UNION ALL SELECT -1 AS cnt FROM dual ) , events AS ( SELECT CASE cntr.cnt WHEN 1 THEN t.rec_start WHEN -1 THEN t.rec_end END AS dt , cntr.cnt FROM t CROSS JOIN cntr ) , concurrent_users AS ( SELECT TRUNC (dt, 'HH') AS hour , SUM (cnt) OVER (ORDER BY dt) AS concurrent_users FROM events ) SELECT hour , MAX (concurrent_users) AS max_of_conc_users FROM concurrent_users GROUP BY hour ORDER BY hour;
Output:
HOUR MAX_OF_CONC_USERS ---------------- ----------------- 01.10.2009 12:00 2 01.10.2009 13:00 3 01.10.2009 14:00 3
Maybe you are looking for
-
Internet high speed &; 1stgen AirportExpress
Recently I upgraded my internet speed to 150Mbps. using my (model A1264) 1stGen Airport Express, I am only able to get 50Mbps to my office. My iMac is at short range with my router. My internet is slow speed b/c my Express is outdated? A new Express
-
Equium A110-252 his problem glancing a DVD movie
Hi all I have the problem with the sound of the CD/DVD. In fact, it is impossible to watch any movie DVD. The sound is tinny and distorted. Picture is not as clear and chopped. The thing is when I look at something HD or web, everything is absolutely
-
AGP Texture acceleration: Not available
HP 530 Notebook Windows XP Professional SP3 Intel Celeron (r) 1.6 GHz, 504 MB RAM In RUN - DXDIAG - Display - (AGP Texture acceleration) is not available.How could I allow it, what I have to install or do... ? Please answer, thank you!
-
DVD not recognized writers more - please help!
I have a Dell Studio 1555 laptop that came with a DVD - RW drive. A year ago, my husband did a single DVD for a few friends, using the Windows DVD Maker program. It worked! Unfortunately, it worked only once. The next time we tried, the DVD - RW driv
-
Need for WLAN, drivers WIFI for HP Pavilion 15-n011tu on windows 7
Hello Need for WLAN, drivers WIFI for HP Pavilion 15-n011tu on windows 7? Please let me know I can load it. Thank you