to display several values in the column as a simple comma separated
Hello..My the source table structure is as
test_123
person_id varchar2,
phone_no varchar2
A unique person_id can have several phone_nos
as
person_id phone_no
123 1245
123 1246
123 1247
12460 124
124 12461
Now I want the output voltage
person_id phone_no
123 1245,1246,1247
124 12460,12461
How d she?
I want it in a single query?
Many many many examples here.
http://www.Oracle-base.com/articles/Misc/StringAggregationTechniques.php
Tags: Database
Similar Questions
-
Display several values on the front using the table
For example, if I enter "10" for number of datapoints, I want to see 10 hexadecimal and binary all values in a column. At present, only 1 value appears and erasing all of the previous values
Thank you!
You do not use a shift register to store the values in the table between the fo the loop iterations For.
It is a fundamental concept of LabVIEW.
I recommend you watch the LabVIEW tutorials online
LabVIEW Introduction course - 3 hours
LabVIEW Introduction course - 6 hours -
Display a value in the column only if the number is greater than 1
I need to return a value in the only if column the the count is greater than 1 for the same column.
Example table:
FOOD_TYPE Agenda COST_TO_BUY SELL_PRICE Ice cream Chocolate 0.50 2.00 Ice cream Vanilla 0.50 2.00 Ice cream Strawberry 0.50 2.00 Chicken Wings 2.00 5.00 Bovine meat Steaks 8.00 15 h 00 Bovine meat Roast 10 h 00 6:00 pm In this example, I want to choose the POINT of FOOD_TYPE, SUM (COST_TO_BUY) AND SUM (SELL_PRICE), but I want only to select the ITEM if there is more than 1 points in the FOOD_TYPE.
I tried all kinds of grouping and even including a case statement in select it as follows:
CASE
WHEN (COUNT (DISTINCT POINT) > 1)
THEN THE POINT
ELSE "
END
However, this is denied when I group because it forces me to use the POINT as a group and I can't use the set statement in the GROUP BY because it has an aggregate function.
Help, please!
with
power as
(select food_type 'Beef', 'Steaks' article, cost_to_buy 8.00 15.00 sell_price of all the double union)
Select 'Beef', 'Roast', 10.00, 18.00 double Union all
Select 'Chicken', 'Wings', 2.00, 5.00 double Union all
Select 'Ice Cream', 'Chocolate', 0.50, 2.00 double Union all
Select "Ice Cream", "Vanilla", 0.50, 2.00 double Union all
Select "Ice Cream", "Strawberry", 0.50, 2.00 double
)
Select food_type 'Type of food. "
cases where the head (separate) over (partition food_type) > 1 then end point "Item,"
TO_CHAR (cost_to_buy, 'fm990.00') "Purchase cost"
TO_CHAR (sell_price, 'fm990.00') 'selling price '.
food
food_type desc order
Food Type Item Purchase cost Sell Price Ice cream Chocolate 0.50 2.00 Ice cream Strawberry 0.50 2.00 Ice cream Vanilla 0.50 2.00 Chicken - 2.00 5.00 Bovine meat Roast 10 h 00 6:00 pm Bovine meat Steaks 8.00 15 h 00 Concerning
Etbin
-
Update of several values in the column
Is not a matter of complicated and likely, I use a wrong syntax, but I'm trying to update the values in different columns in the same query
I'm doing this
update cm_item_master i set i.dept = 'VIVERES', set i.class = 'PASTAS', set i.subclass 'ESPECIALIDADES' where i.ITEM = '1.1005292'
update cm_item_master i set i.dept = 'VIVERES', i.class = 'PASTAS', i.subclass 'ESPECIALIDADES' where i.ITEM = '1.1005292'
-
Displays two values in the column with the concatenation of good
I have a query Select col1 | ' >' || col2 from table1.
For example: the table below has the records.
Col1 Col2
Orange color
red color
White color
Yellow color
Result of: existing query
Orange > color
Red > color
White > color
Yellow > color
But I want to display two columns in the order appropriate as the below one.
Veuileez note that all the the first character of the col2 must start the position of sampe in a row.
Orange > > color
Red > > > > color
White > > > color
Yellow > > > colorHello
Knowing the value that should be completed when running...SQL> with tab as 2 (select 'Orange' Col1, 'color' Col2 from dual union all 3 select 'red' , 'color' from dual union all 4 select 'White' , 'color' from dual union all 5 select 'Yellow' , 'color' from dual) 6 Select RPAD(col1,(select max(length(col1)) +1 7 from tab),chr(32))||chr(9) ||col2 data 8 from tab; DATA -------------------------------------------------------------- Orange color red color White color Yellow color
Twinkle
-
How to display the value of the column
Oracle 10g on Linux
I want to display the value of the id column in the table of www if count (distinct id) is 1. The following query is fine except that it does not display the value of the column ID help, please.
SELECT count(distinct id) FROM www c WHERE C.x_code IN (SELECT D.x_code FROM www_app d WHERE d.y_code = '1151299386') having count(distinct id) = 1
I think you can use MAX in this case
SELECT max(id) FROM www c WHERE C.x_code IN (SELECT D.x_code FROM www_app d WHERE d.y_code = '1151299386') having count(distinct id) = 1
-
Add numeric value in the column in the Table
Hello
My problem:
I have a VO with a numeric attribute (Sal). This VO is present in a table in a JSF Page.
I need to add a numerical value to the value of the column.
I have try it with #{row.bindings.Sal.attributeValue * 2} or #{rank. SAL + 2} or #{rank. Sal.inputValue + 2} but I get an error.
Can someone help me?
Thank you
11.1.3 JDevHello
one option would be to use a transitional attribute in the VO to calculate math or to fill in the field column of a managed bean. You can point the field for the column to a property of the managed bean (say sumSal). In this getSumSal() method you
1. use ELContext and ValueExpression ExpressionFactory to resolve the reference #{line} (you can cast oracle.jbo.domain.Row
2. call the row.get ("attribute_name") to access the value of the field
3 compute and return the value to display in the tableNote that using a transitional attribute may be easier to achieve and easier to reuse in other uses of the VO. However, you will have options
Frank
-
Partial Page rendering - refresh value in the column
Hi gurus of the OFA.
I created a page of creation and followed the tutorial on Partital page made by creating a view PVO object and I am able to make the "EmployeeNumber" / "Location" column true false GOLD according to the value of another field (area).
The 'TypeMonitored' (choice of message) has 2 values (area/employee). If the user selects the 'zone' then "EmployeeNumber" column should be hidden and if the user selects 'Employee', then the 'Place' column should be hidden. It works very well.
My problem is if the user has selected 'Employee' in the 'TypeMonitored' of poplist and registered the "EmployeeNumber" and then immediately again if the user selects "Domain" of the "TypeMonitored" of poplist and enters the 'place' (since the site is now visible to the user) and click on Save and then the record is get recorded with the two values. I need to have the value of the column of 'Employee' to be empty in this case.
Basically need to SETTING / erases the value of EmployeeNumber before any record in the database.
Any help would be appreciated to greatlly. Please let me know if you want more details.
Thank you
Mir
Here is my Code AMImpl
===============
package lac.oracle.apps.lac.lacempexposure.server;
Import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
Import oracle.apps.fnd.framework.server.OAViewObjectImpl;
Import oracle.jbo.Row;
Import oracle.apps.fnd.framework.OAViewObject;
Import oracle.jbo.Transaction;
Import oracle.jbo.domain.Number;
Import oracle.apps.fnd.framework.OARow;
Import oracle.apps.fnd.common.MessageToken;
Import oracle.apps.fnd.framework.OAException;
// ---------------------------------------------------------------------
-File generated by Oracle ADF business components Design-time.
-Custom code can be added to this class.
-WARNING: do not change the methods generated method signatures.
// ---------------------------------------------------------------------
SerializableAttribute public class LacEmpExposureAMImpl extends OAApplicationModuleImpl {}
/ * This is the default constructor (do not remove)
*/
public LacEmpExposureAMImpl() {}
}
/*
*****************************************************************
* Initializes the application transient VO properties.
*****************************************************************
*/
public void init()
{
System.out.println ("in LACEmpExposureAMImpl.java IN init");
System.out.println (LacTypeMonitored);
OAViewObject appPropsVO = (OAViewObject) findViewObject ("LacExpCreatePVO1");
If (appPropsVO! = null)
{
Not reset the VO unless necessary. Note that this method
not trying to query the database for your with no SELECT statement
and only transient attributes.
If (appPropsVO.getFetchedRowCount () == 0)
{
Set the mapping size extraction to 0 to a VO in memory
It prevents to try the query lines. The call
executeQuery() ensures that the lines are not lost after
validation under (workaround for known issue of BC4J) operation.
appPropsVO.setMaxFetchSize (0);
appPropsVO.executeQuery ();
You must create and insert a line in the original Version, before you start
definition of the properties.
appPropsVO.insertRow (appPropsVO.createRow ());
Set the primary key for this single-rwo VO.
Line OARow = (OARow) appPropsVO.first ();
row.setAttribute ("RowKey", new Number (1));
}
} / / Initialization of application VO properties (and the user interface) based on the
Tracking to default value set on the underlying object Type.
handleTypeMonitoredChangeEvent();
} / / end of init()
/*
* *******************************************************
Manages the poplist TypeMonitored changes to set the
* application properties value of PRR VO
* *******************************************************
*/
Public Sub handleTypeMonitoredChangeEvent()
{
Get the properties of special application, einreihig, and make the
First (only) current line.
OAViewObject vo = (OAViewObject) findViewObject ("LacExpCreatePVO1");
Line OARow = (OARow) vo.first ();
Get the value of the attribute of the object from view with the code TypeMonitored
OAViewObject LacEmpExposureCreateVO = (OAViewObject) findViewObject ("LacEmpExposureVO1");
OARow LacEmpExposureCreateRow = (OARow) LacEmpExposureCreateVO.getCurrentRow ();
String LacTypeMonitored = (String) LacEmpExposureCreateRow.getAttribute ("TypeMonitored");
System.out.println ("in LACEmpExposureAMImpl.java IN handleTypeMonitoredChangeEvent");
System.out.println (LacTypeMonitored);
row.getAttribute ("LocationMonitoredRender");
System.out.println (Row.GetAttribute ("LocationMonitoredRender"));
If (("Personal".equals (LacTypeMonitored)))
{
row.setAttribute ("LocationMonitoredRender", Boolean.FALSE);
row.setAttribute ("EmployeeNumberRender", Boolean.TRUE);
row.setAttribute ("FullNameRender", Boolean.TRUE);
}
else if (("Area".equals (LacTypeMonitored)))
{
row.setAttribute ("LocationMonitoredRender", Boolean.TRUE);
row.setAttribute ("EmployeeNumberRender", Boolean.FALSE);
row.setAttribute ("FullNameRender", Boolean.FALSE);
}
} / / handleTypeMonitoredChangeEvent()
/ * Main sample for debugging code of business using the tester components.
*/
Public Shared Sub main (String [] args) {}
launchTester ("lac.oracle.apps.lac.lacempexposure.server", / * name of the package * /)
("LacEmpExposureAMLocal" / * Configuration name * /);
}
/ * Getter of the container for LacEmpExposureVO1
*/
public OAViewObjectImpl getLacEmpExposureVO1() {}
return (OAViewObjectImpl) findViewObject ("LacEmpExposureVO1");
}
/ * Getter of the container for EmployeeNamesLovVO1
*/
public OAViewObjectImpl getEmployeeNamesLovVO1() {}
return (OAViewObjectImpl) findViewObject ("EmployeeNamesLovVO1");
}
/ * Getter of the container for MonitoringTypeVO1
*/
public OAViewObjectImpl getMonitoringTypeVO1() {}
return (OAViewObjectImpl) findViewObject ("MonitoringTypeVO1");
}
/ * Getter of the container for LacParameterMonitoredVO1
*/
public OAViewObjectImpl getLacParameterMonitoredVO1() {}
return (OAViewObjectImpl) findViewObject ("LacParameterMonitoredVO1");
}
/*
*******************************
* Creates a new record of the exhibition
*******************************
*/
Public Sub CreateLacEmpExposure()
{
OAViewObject vo = (OAViewObject) getLacEmpExposureVO1 ();
By coding standards, it is the right way of
initialize a VO that is used for queries and inserts.
See the objects in view in detail in the developer's Guide can do for
Additional information.
System.out.println ("in LACEmpExposureAMImpl.java IN CreateLacEmpExposure");
If (!) VO.isPreparedForExecution ())
{
vo.executeQuery ();
}
Line = vo.createRow ();
vo.insertRow (row);
Required by OA Framework model M69 coding standards
row.setNewRowState (Row.STATUS_INITIALIZED);
} / / end CreateLacEmpExposure
/*
*****************************************************************
* Performs a rollback, including the database and the middle-tier
*****************************************************************
*/
Public Sub rollbackLacEmpExposure()
{
Transaction txn = getTransaction();
This small optimization ensures that we do not have persorm a restore
If you have not to.
If (txn.isDirty ())
{
TXN. Rollback();
}
} / / end rollbackLacEmpExposure()
/ * Getter of the container for LacEmpExposureLOVDataVO1
*/
public OAViewObjectImpl getLacEmpExposureLOVDataVO1() {}
return (OAViewObjectImpl) findViewObject ("LacEmpExposureLOVDataVO1");
}
/*
* *****************************
* Commits the transaction
* *****************************
*/
public void Apply()
{
getTransaction () .commit ();
} / / end apply()
/ * Getter of the container for LacExpCreatePVO1
*/
public OAViewObjectImpl getLacExpCreatePVO1() {}
return (OAViewObjectImpl) findViewObject ("LacExpCreatePVO1");
}
/*
***********************************************************************
* Initializes the request of employee details for the Update Page.
***********************************************************************
*/
public void initDetailsUpdate (String EmployeeNumber,
String FullName,
String RecordSeq)
{
System.out.println ("in LACEmpExposureAMImpl.java IN initDetailsUpdate");
System.out.println ("LACEmpExposureAMImpl == > EmployeeNumber in initQueryUpdate is:" + EmployeeNumber);
System.out.println ("LACEmpExposureAMImpl == > FullName in initQueryUpdate is:" + FullName);
System.out.println ("LACEmpExposureAMImpl == > RecordSeq in initQueryUpdate is:" + RecordSeq);
OAViewObjectImpl vo = getLacEmpExposureVO1();
LacEmpExposureEditVOImpl vo = (LacEmpExposureEditVOImpl) getLacEmpExposureEditVO1 ();
OAViewObject vo = (OAViewObject) getLacEmpExposureVO1 ();
If (vo is nothing)
{
MessageToken [] errTokens = {new MessageToken ("parameter", "LacEmpExposureVO1")};
throw new OAException ("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
}
ToL InitQueryUpdate (EmployeeNumber, FullName, RecordSeq);
Line row = vo.first ();
vo.setCurrentRow (row);
/*
Since we will interview a single row with a primary key value, we
can use the findByKey method, which first checks the cache of BC4J
and if it does not find one matching row, it will put forward a request for help
the given key and retrieve it from the database.
String [] keys = {employeeNumber};
Line lines [] = vo.findByKey (new Key (keys), 1);
You must set the current line, or the details page will not display any
data. When you explicitly query data, you don't have to do it.
If (rows! = null)
{
vo.setCurrentRow(rows[0]);
}
*/
} / / end initDetails()
/ * Getter of the container for LacEmpExposureEditVO1
*/
public LacEmpExposureEditVOImpl getLacEmpExposureEditVO1() {}
return (LacEmpExposureEditVOImpl) findViewObject ("LacEmpExposureEditVO1");
}
} / / end of class LacEmpExposureAMImplHello
In your LacTypeMonitored / / I guess it will fire when you change the value of employee poplist form in area
Add logic for null value, the value of the employee
If (("Area".equals (LacTypeMonitored)))
{row.setAttribute ("LocationMonitoredRender", Boolean.TRUE);
row.setAttribute ("EmployeeNumberRender", Boolean.FALSE);
row.setAttribute ("FullNameRender", Boolean.FALSE);Change the attribute used to null
(OARow) LacEmpExposureCreateVO.getCurrentRow () .setAttribute ("", null); }
Let me know that it works.
Thank you
With respect,
Kali.
OSSI. -
need to update the value of the column automatically (exists and the new value)
Hello
(1) I Segment1, Segment2, Segment3, Segment4, item_status (new column modified in the Temp table)
Must update the form OFA and the DB Temp table item_status value in the column when I click APPLY to SAVE the Inserted records in the DB table and form and must register the mtl_system_items_b Segment1, Segment2, Segment3, Segment4 in which the condition
Note: need to update automatically item_status for existing and new inserted records in the Table and the form
Serializable[] param = {Segment1, Segment2, Segment3, Segment4 }; am.invokeMethod("InsertRecord", param); row.setAttribute("SelectFlag", "N");
Thank you
Renon,
When you write code, try to understand what makes each line. (If you don't understand all the lines, feel free to ask)
row.setAttribute ("ItemStatus", row.getAttribute ("ItemStatus"));
What do you think that the above line done? You try to get the value of the attribute and trying to put the same value. How is it, that will have an impact?
You need to do 2 things.
1. change the insertRecord method and the State of return of this method.
Change the definition of the function:
public String InsertRecord (String itemstyle, String itemcust, String itemsize, String itemcolor, String ordrno,
String desc)
Add a return statement at the end after validation.
TR.Commit ();
return the situation;
}
2 accept that status in CO and set the value to the attribute details VO.
String status = (String)am.invokeMethod ("InsertRecord", param);
row.setAttribute ("ItemStatus",status);
I hope this helps.
See you soon
AJ
-
update line and reset the value of the column
I have table (CORS_MTR) with 3 columns...
SEQ ID of the EPR the ID of the child / / desc 100 22 1 one 101 22 2 two new entry as 1 number , that means change the flow of child #
102 22 3 three When I enter the new line in number of children 1 instead of 2 and then the values of the column (child id, desc) another need to be reset as...
SEQ ID of the EPR the ID of the child / / desc 100 22 2 two 101 22 1 one 102 22 3 three 103 22 4 four SEQ PRT_ID CHILD_ID DESC_ 100 22 1 one 101 22 2 two 102 22 3 three declare
number of p_seq: = 103;
number of p_prt_id: = 22;
number of p_child_id: = 1;
p_desc varchar2 (25): = 'a ';
Start
Update cors_mtr
set seq = case when child_id = p_child_id
then seq + 1
other seq - 1
end
where prt_id = p_prt_id
and child_id (p_child_id, p_child_id + 1);
insert into cors_mtr (seq, prt_id)
values(p_seq,p_prt_id);
Update cors_mtr
Set child_id = (select max (child_id) + 1 of the cors_mtr).
desc_ = (select to_char (to_date (max (child_id) + 1, 'J'), 'jsp') of cors_mtr)
where child_id is null.
end;
SEQ PRT_ID CHILD_ID DESC_ 100 22 2 two 101 22 1 one 102 22 3 three 103 22 4 four Concerning
Etbin
-
Change quick values to 'ALL' of 'all values in the column.
HelloI want to change the 'all values in the column' value for 'all' in the quick view of dashboard.
I went to the location following: < MW_HOME > / Oracle_BI1/bifoundation/web/msgdb/l_en/messages /.
But I am unable to determine which xml file to be changed.
Help, please.
Just in case where to check Srinivasan Software Solutions Pvt.Ltd.: [OBIEE 11 g] customization invites "All THE values in column" Custom value
-
Dynamically by passing the values in the columns
Hi all
I'm trying a pl/sql block that take a string and execute it dynamically. Suppose that here is the string
M_COL: = Q' [(Code_P = > ': DEPTNO', P_CODE_TYPE = > "ÉTAT")]';
Now try to run. using below
M_STR: = 'SELECT CHK_DEPT ' | M_COL | ' FROM EMP WHERE EMPNO = "7499" ';
RUN IMMEDIATELY M_STR
IN M_DATE;
Now what I want is M_STR vairable executed as
SELECT CHK_DEPT (Code_P = > DEPTNO, P_CODE_TYPE = > 'STATE') FROM EMP WHERE EMPNO = '7499'
Instead of
SELECT CHK_DEPT (Code_P = > 'DEPTNO', P_CODE_TYPE = > 'STATE') FROM EMP WHERE EMPNO = '7499'
another other way in the Code_P column DEPTNO value parameter must be passed. Also note that the DEPTNO column in the M_COL string is Dynamic.i.e
M_COL: = Q' [(Code_P = > ': DEPTID', P_CODE_TYPE = > "ÉTAT")]'; OR
M_COL: = Q' [(Code_P = > ': EMP_ID', P_CODE_TYPE = > "ÉTAT")]';
Any suggestions, please share with me.
And also, please don't bother much about the data and the output of function. If I get a way to pass the value of the column in function, my problem is solved.
-
How to display Quick values in the story
With the help of 11.1.1.6.2
In a dashboard page, I have a table with a hierarchy of dimension for the organization. If you click on a division he runs a link action to call a script in the browser (javascript in a text on the dashboard section) from the division. If you expand the section, and then click on a market, it calls the function javascript even.
Then, the Javascript function uses path go to update an analysis in an iFrame on the dashboard page and passes the value of the Division or the market value.
The analysis of the target has two filters: Division is invited and the market is invited.
So, after all, my question is how could display two values from the call of the road go into a narrative on the analysis of the target? Or I guess the other question is how to view the filter on the narrative values.
Sorry for the long explanation, but I hope it makes sense.
Thanks for any help or suggestion.
BradTry something using the Div tag
for ex:
< div id = filterValues > @{WeekBetween} {Default Value} < / div >
< script >
var i = document.getElementById('filterValues').innerHTML;
document.getElementById('filterValues').innerHTML = aParams ["varDivision"];
< /script >If brand pls help
-
How can I replace the value of the column with a particular value in SQL
Hi all
Is someone can you please tell me how can I format my output with the replacement of a column value with a specific value that really depends on the current value of the column
I am executing the following SQL statement
Select state, count (id) from < table_name > where composite_dn = < composite_dn_name > Group by State;
My current performance is:
State Instance number
1 3
3 28
I want to replace the value in the State column as follows
No.OfInstances State
3 filled
28 faulted
I want '1' to be reppaced of 'Done' and '3' is replaced by 'Faulted. '
Is is possible with SQL or PL/SQL, if it is then how I can achieve this required. Help, please!
Thanks in advance!
Published by: Roshni Shankar on October 27, 2012 12:38 AMHi Claude,.
I guess this CASE clause can be simulated by a DECODE and also it is very easy to use.
See - http://www.techonthenet.com/oracle/functions/decode.phpselect decode(t1.state,t2.state_id,t2.state_name), t1.count_id from
t2, (select state,count(id) count_id from where composite_dn= group by state) t1 where t1.state = t2.state_id; HTH
Vanessa B.Published by: Vanessa B on October 27, 2012 14:02
-link addedPublished by: Vanessa B on October 27, 2012 14:19
-added code sample -
How to find if the DEFAULT VALUE of the COLUMN is stored as metadata?
Hello
I am using Oracle 11 g enhanced functionality add a COLUMN. Adding new columns with the DEFAULT values and unconstrained NULL is no longer requires that the default value in all existing records.
Sometimes, we change DB columns not NULL with default with the DEFAULT value null. This operation "materialize" the default for the column.
Y at - it an easy way (see Dictionary) how to find the default value of the COLUMN is stored as metadata or 'materializes '?
Thank you. Filip
Version of Oracle RDBMS: Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit ProductionLook at the table SYS COL$. He has a column called PROPERTY.
It will have the magic number 1073741824 for columns that have been added by using this new feature...
Maybe you are looking for
-
Can you make a band. that you can wear on your nek for Apple Watch
Hello. I have a question. Can you make a band. that you can wear on your nek as a necklace? I'm looking for this concept some time, but it is not available? Best regards Pascal scholten
-
Removing items from system preferences
I have 3 unknowns to my system preferences that is no longer, I do not know how to remove. I think they are in the library? or what?
-
My HP Pavilion P7-1120 Desktop PC does not work with two screens - there 8gig of ram... 1.5 terabyt hard drive, Windows 7 64-bit primary system works via the VGA port, but the second screen does not rest via the DVI port. The two normal startup wit
-
I would be able to put a SSD of Sandisk SDSSDX on my e6420 and make my main drive? Is it compatible? I intend to put just a clean copy of windows on it.
-
Hello I don't know if maybe the camera Documentation is not aligned with the API documentation. I was wondering if someone could guide me toward the Dev Alpha camera to record. The following code gets the camera started correctly. // Initialize Video