How to get multiple records by using group by caluse
Description of table:
I have one table Exposureid(primary key),Name,Address,City,State,County,Zip,Occupation .
Description of Query Result that I want:
I wanrt all exposureid which has duplicate Address+City+State+Zip+County+Occupation as a single record
(those exposures that has same address and occupation )
The GROUP BY clause will give you a list of unique addresses. Adding HAVING COUNT(*) > 1 will give you all addresses that are used more than once.
A sub-select can then be used to determine which unique rows have these duplicates, e.g.
select
from table t1
where (t1.col1, t2.col2, t3.col3) in
( select
t2.col1, t2.col2, t2.col3
from table t2
group by
t2.col1, t2.col2, t2.col3
having count(*) > 1
Similar Messages
-
How to get multiple records using fn-bea:execute-sql()
Hi,
I created Proxy service(ALSB3.0) to get records from DB table. I have used Xquery function(fn-bea:execute-sql()). Using simple SQL query I got single record, but my table having multiple records. Please suggest how to get multiple records using fn-bea:execute-sql() and how to assign them in ALSB variable.
Regards,
Nagaraju
Edited by: user10373980 on Sep 29, 2008 6:11 AMHi,
Am facing the same issue stated above that I couldnt get all the records in the table that am querying in the Proxyservice.
For example:
fn-bea:execute-sql('EsbDataSource', 'student', 'select Name from StudentList' ) is the query that am using to fetch the records from the table called StudentList which contains more than one records like
Id Name
01 XXX
02 YYY
03 ZZZ
I tried to assign the result of the above query in a variable and while trying to log the variable, I can see the below
<student>
<Name>XXX</Name>
</student>
I want to have all the records from my table in xml format but it's not coming up. I get the value only from the first row of my table.
Please suggest.
regards,
Venkat -
How to get multiple records from internal table through BDC
PERFORM DYNPRO USING:
'X' 'SAPMM61L' '0500',
' ' 'BDC_OKCODE' '=NEWC',
'X' 'SAPMM61L' '0500',
' ' 'BDC_CURSOR' 'PLPTU-PLWRK(01)',
' ' 'BDC_OKCODE' '=TAKE',
' ' 'PLPTU-PLWRK(01)' '2531'. (2531 is a plant)
This is the recording used to get plant via BDC of MS31.
Using this code i can get only single plant...
If i want to get multiple plants from an internal table,how i can change this code?
Since it is a recording i cant put this code in LOOP..ENDLOOP.
Suggest any method for doing this....
Awaiting for ur reply...Hi,
While recording also record the scroll down button.
The you can place different plant in the BDC using loop and endloop
Regards
Arun -
How to get Multiple records from functions
Hi Everyone
Im new to this stuff. Im trying through JCO. As far as the single recordsets like data of customer or article are concerned i get it through an array.
But i wanted to retrieve
1- Whole tables like (all articles)
2- Selected articles. or Customer order details (articles in PO)
That means multiple records in one go.
Later on ill display it in JTables.
Like for the past three days i was googling around. Thought like this ones not for my stomach. Came across this Forum. Thought its worth posting a request.
Here is the code
public String[] KSearch(String Knr) throws Exception{
String[] Result=new String[11];
IFunctionTemplate ftemplate= Con.repository.getFunctionTemplate("SucheKUNDE");
if (ftemplate == null)
throw new Exception("Funktionstemplate nicht gefunden");
JCO.Function function = ftemplate.getFunction();
JCO.ParameterList input = function.getImportParameterList();
input.setValue(Knr,"FieldName");
JCO.Client client = JCO.getClient(Con.conPoolId);
client.execute(function);
JCO.ParameterList output = function.getExportParameterList();
Result[0]=output.getString("NAME");
Result[1]=output.getString("VORNAME");
Result[2]=output.getString("GDATE");
Result[3]=output.getString("TELEFON");
Result[4]=output.getString("MAIL");
Result[5]=output.getString("STRASSE");
Result[6]=output.getString("PLZ");
Result[7]=output.getString("ORT");
Result[8]=output.getString("KONTO");
Result[9]=output.getString("INSTITUT");
Result[10]=output.getString("BLZ");
JCO.releaseClient(client);
return Result;
now instead of a single record what if im expecting a number of records, like what if i need customer over 25. Which means more than one. I have to get in tabular format so that i can display it in JTables.
Hope it a bit illustrative.
Regards
Edited by: Aaron Maleck on Jan 5, 2008 7:35 AMpublic String[] KSearch(String Knr) throws Exception{
String[] Result=new String11;
IFunctionTemplate ftemplate= Con.repository.getFunctionTemplate("SucheKUNDE");
if (ftemplate == null)
throw new Exception("Funktionstemplate nicht gefunden");
JCO.Function function = ftemplate.getFunction();
JCO.ParameterList input = function.getImportParameterList();
input.setValue(Knr,"FieldName");
JCO.Client client = JCO.getClient(Con.conPoolId);
client.execute(function);
// Maybe here you should use a JCO.Table Class to get the //ExportParameters such as
JCO.Table output = function.getTableParameterList().getTable( "tabelname" );
// so you can use setRow() Function to get the information of the //relevant record. such as the 3. Costum
output.setRow(3);// Record Number
Result[0]=output.getString("NAME");
Result[1]=output.getString("VORNAME");
Result[2]=output.getString("GDATE");
Result[3]=output.getString("TELEFON");
Result[4]=output.getString("MAIL");
Result[5]=output.getString("STRASSE");
Result[6]=output.getString("PLZ");
Result[7]=output.getString("ORT");
Result[8]=output.getString("KONTO");
Result[9]=output.getString("INSTITUT");
Result10=output.getString("BLZ");
JCO.releaseClient(client);
return Result;
Iam not sure that works. But you can try it. and reply me to tell if it really works as i think.
Hope helps.
Amao -
Data merging: how to get multiple records in single text frame?
Hi
I'm experimenting with data merging in InDesign CS3. The biggest stumbling block I've come across is trying to get my records to flow as continuous text in a single text frame (which would, ideally, autoflow onto new pages in the document). The records vary considerably in length, and so I can't just create a standard text frame to repeat on the page.
Perhaps data merging isn't the best way of doing this and I should be learning to script instead. I feel like I'm just one step away, though.
Any suggestions would be appreciated.OK, new scenario now:
Is it possible to set a text box to auto-resize to fit the content that comes in during the data merge?
I have placed one of my data fields in a text box with a stroke and fill, and placed this as an anchored object in the main text box with the other fields. The problem is that the length of text in this field varies considerably, and I'd like the text to fit snugly within its box. Ideally this text box would not appear at all if the field is blank for a particular record.
I hope I've explained all of that clearly enough. Any ideas? -
How to get multiple records in one row and different column
Hi All,
I am using oracle database 11g
and i have a two tables table_1, table_2
table_1 having columns
emp_no
first_name
middle_name
last_name
email
and table_2 having columns
emp_no
phone_type
phone_number
and having entires
emp_no phone_type phone_number
1001 MOB 9451421452
1001 WEMG 235153654
1001 EMG 652341536
1002 MOB 9987526312
1003 WEMG 5332621456
1004 EMG 59612356
Now i want the output of values with phone type as MOB or WEMG in a single row with different columns
emp_no first_name middle_name last_name email mobile officeno
1001 mark null k [email protected] 9451421452 235153654
1002 john cena gary [email protected] 9987526312 null
1003 dany null craig [email protected] null 5332621456
1004 donald finn sian [email protected] null null
can i have any inputs to achive this???
Regards
$sidFrank Kulash wrote:
sonething like this:Frank, you missed aggregate function (pivot requires one). However main thing is it will cause ORA-01748:
with table_1 as (
select 1001 emp_no,'mark' first_name,null middle_name,'k'last_name,'[email protected]' email from dual union all
select 1002,'john','cena','gary','[email protected]' from dual union all
select 1003,'dany',null,'craig','[email protected] null' from dual union all
select 1004,'donald','finn','sian','[email protected]' from dual
table_2 as (
select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
select 1001,'WEMG',235153654 from dual union all
select 1001,'EMG',652341536 from dual union all
select 1002,'MOB',9987526312 from dual union all
select 1003,'WEMG',5332621456 from dual union all
select 1004,'EMG',59612356 from dual
SELECT *
FROM table_1 t1
JOIN table_2 t2 ON t1.emp_no = t2.emp_no
PIVOT ( max(t2.phone_number)
FOR t2.phone_type IN ( 'MOB' AS mob
, 'WEMG' AS wemg
FOR t2.phone_type IN ( 'MOB' AS mob
ERROR at line 19:
ORA-01748: only simple column names allowed hereYou need to:
with table_1 as (
select 1001 emp_no,'mark' first_name,null middle_name,'k' last_name,'[email protected]' email from dual union all
select 1002,'john','cena','gary','[email protected]' from dual union all
select 1003,'dany',null,'craig','[email protected] null' from dual union all
select 1004,'donald','finn','sian','[email protected]' from dual
table_2 as (
select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
select 1001,'WEMG',235153654 from dual union all
select 1001,'EMG',652341536 from dual union all
select 1002,'MOB',9987526312 from dual union all
select 1003,'WEMG',5332621456 from dual union all
select 1004,'EMG',59612356 from dual
table_3 as (
select t1.emp_no,first_name,middle_name,last_name,email,
phone_type,phone_number
FROM table_1 t1
LEFT JOIN table_2 t2 ON t1.emp_no = t2.emp_no
SELECT *
FROM table_3
PIVOT ( max(phone_number)
FOR phone_type IN ( 'MOB' AS mob
, 'WEMG' AS wemg
EMP_NO FIRST_ MIDD LAST_ EMAIL MOB WEMG
1004 donald finn sian [email protected]
1003 dany craig [email protected] null 5332621456
1001 mark k [email protected] 9451421452 235153654
1002 john cena gary [email protected] 9987526312
SQL>SY. -
Please Help! Deleting multiple record by using checkbox selected
Hello everybody,
I am a new to JSP. I really don't know how to delete multiple record by using checkbox selected and pressing submit button.
For example, deleting webmailbox letters using checkbox selected and delete button. The mail we checked will delete from the inbox.
I like to use my user account deleting system of my project like above example.
How can I do in JSP? I will very please you if you share you knowledge and code for me.
If you have URL address, could you share me for reference?
Please help me...
With Thanks and Regards,
wtdahlTake a look at this thread, I thing it answers your question quite good:
http://forum.java.sun.com/thread.jsp?thread=516658&forum=45&message=2463505 -
Can i get multiple records if selection screen is 900 using PROVIDE
Hi All,
Iam using following statement for fetching MULTIPLE records from infotype 0008. In Attributes if i declare LDB as pnp and selection screen as 900, then iam not getting any records.
Instead of th selection screen 900 is empty. then records will getting properly.
How can i get multiple records if selection screen is 900?
PROVIDE * FROM p0008
between pn-begda and pn-endda.Hi Ranjith
You can use
PYBEGDA and PYENDDA instead of PN-BEGDA AND PN-ENDDA.
Regards
Muneer.VK -
How to pass multiple records to target side using xquery
Hi Everybody,
I am using xquery transformation.
Input: Source payload contains 5 variables.
Target payload contains 5 variables.
I have input with payload with multiple instance like:
<Input>
<payload1>
<a>1<a>
<b>2<b>
<c>3<c>
<d>4<d>
<e>5<e>
</payload1>
<payload1>
<a>6<a>
<b>7<b>
<c>8<c>
<d>9<d>
<e>10<e>
</payload1>
</Input>
So my requirement is to pass above records into target side,
So I am using xquery Transformation.
I have written code as follows.
(:: pragma bea:global-element-parameter parameter="$tHRecAdv1" element="ns0:THRecAdv" location="../XMLSchemas/THRecAdv.xsd" ::)
(:: pragma bea:global-element-return element="ns1:ShipmentReceiptEBO" location="../../AIAReferenceModelProject/EnterpriseObjectLibrary/Core/EBO/ShipmentReceipt/V1/ShipmentReceiptEBO.xsd" ::)
declare namespace ns2 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/EBO/ShipmentReceipt/V1";
declare namespace ns1 = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/ShipmentReceipt/V1";
declare namespace ns4 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2";
declare namespace ns3 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/Common/V2";
declare namespace ns0 = "http://diversey.com/THRecAdv";
declare namespace xf = "http://tempuri.org/ShipmentReceiptServicesProject/XMLTransformations/THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery/";
declare function xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1 as element(ns0:THRecAdv))
as element(ns1:ShipmentReceiptEBO) {
for $THRecAdvFields in $tHRecAdv1/ns0:THRecAdvFields
return
<ns1:ShipmentReceiptEBO>
<ns4:Identification>
<ns4:BusinessComponentID>{ data($THRecAdvFields/ns0:JD_WHSE_Code) }</ns4:BusinessComponentID>
<ns4:ID schemeID = "{ (data($THRecAdvFields/ns0:JD_PO_Number)) }"
schemeVersionID = "{ data($THRecAdvFields/ns0:JD_PO_Type) }">{ data($THRecAdvFields/ns0:WMS_InternalPONumber) }</ns4:ID>
<ns4:ApplicationObjectKey>
<ns4:ID>{ data($THRecAdvFields/ns0:JD_BranchPlant) }</ns4:ID>
</ns4:ApplicationObjectKey>
<ns4:Revision>
<ns4:Reason>{ data($THRecAdvFields/ns0:ReturnReceiptReasonCode) }</ns4:Reason>
</ns4:Revision>
</ns4:Identification>
<ns1:ExpectedReceiptDate>{ data($THRecAdvFields/ns0:WMS_ReceiptDate) }</ns1:ExpectedReceiptDate>
<ns4:InvoiceReference>
<ns4:InvoiceIdentification>
<ns4:ID>{ data($THRecAdvFields/ns0:JDE_SupplierInvoiceNumber) }</ns4:ID>
</ns4:InvoiceIdentification>
</ns4:InvoiceReference>
<ns1:ShipmentReceiptLine actionCode = "{ data($THRecAdvFields/ns0:ActionFlag) }">
<ns4:Identification>
<ns4:ID schemeID = "{ data($THRecAdvFields/ns0:JD_PO_LineNumber) }"
schemeVersionID = "{ data($THRecAdvFields/ns0:ExternPONumber) }">{ data($THRecAdvFields/ns0:WMS_ReceiptNumber) }</ns4:ID>
<ns4:ContextID>{ data($THRecAdvFields/ns0:WMSReceivingClerk) }</ns4:ContextID>
<ns4:ApplicationObjectKey>
<ns4:ID schemeID = "{ data($THRecAdvFields/ns0:BatchNumber) }"
schemeVersionID = "{ data($THRecAdvFields/ns0:BatchLineNumber) }">{ data($THRecAdvFields/ns0:JD_LocationCode) }</ns4:ID>
</ns4:ApplicationObjectKey>
<ns4:AlternateObjectKey>
<ns4:ID>{ data($THRecAdvFields/ns0:SupplierCode) }</ns4:ID>
<ns4:ContextID>{ data($THRecAdvFields/ns0:LineNumber_Or_SequenceNumber) }</ns4:ContextID>
</ns4:AlternateObjectKey>
<ns4:Revision>
<ns4:Label>{ data($THRecAdvFields/ns0:Records) }</ns4:Label>
</ns4:Revision>
</ns4:Identification>
<ns1:ReceivedQuantity unitCode = "{ data($THRecAdvFields/ns0:ReceiptUOM) }">{ data($THRecAdvFields/ns0:UnitReceipt) }</ns1:ReceivedQuantity>
<ns1:SourceDocumentTypeCode>{ data($THRecAdvFields/ns0:SKU_Code) }</ns1:SourceDocumentTypeCode>
<ns1:DestinationTypeCode>{ data($THRecAdvFields/ns0:DestinationProcessFlag) }</ns1:DestinationTypeCode>
<ns1:Comment>{ data($THRecAdvFields/ns0:Remarks) }</ns1:Comment>
<ns4:Status>
<ns4:Code>{ data($THRecAdvFields/ns0:ProcessSourceFlag) }</ns4:Code>
<ns4:EffectiveDateTime>{ data($THRecAdvFields/ns0:ADDDATE) }</ns4:EffectiveDateTime>
</ns4:Status>
<ns1:ShipmentReceiptTransaction>
<ns1:ShipmentReceiptTransactionLot>
<ns1:ShipmentReceiptItemLotReference>
<ns1:ExpirationDate>{ data($THRecAdvFields/ns0:ExpiryDate) }</ns1:ExpirationDate>
<ns1:CreationDateTime>{ data($THRecAdvFields/ns0:ProductionDate) }</ns1:CreationDateTime>
</ns1:ShipmentReceiptItemLotReference>
</ns1:ShipmentReceiptTransactionLot>
</ns1:ShipmentReceiptTransaction>
</ns1:ShipmentReceiptLine>
</ns1:ShipmentReceiptEBO>
declare variable $tHRecAdv1 as element(ns0:THRecAdv) external;
xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1)
But while importing this code to OSB,and tested it ,
With 1 payload it successfully shows the data in Target side,
But while testing with multiple line items,i am getting an error as follows.
*Error executing the XQuery transformation: line 14, column 17: {err}FORG0005: expected exactly one item, got 2+ items*
So please provide me the steps how to pass multiple records to target side using xquery.
Regards,
Jyoti NayakHi Jyoti Nayak,
You have to do something like the example bellow, you can not just repeat the inner element, you will need an outer "container" tag. So you will have to change the target element of your xq transformation.
declare function xf:setToList($set1 as element(ns0:set))
as element(ns0:list) {
<ns0:list>
for $pair in $set1/ns0:pair
return
<ns0:entry>
<ns0:key>{ data($pair/ns0:key) }</ns0:key>
<ns0:value>{ data($pair/ns0:value) }</ns0:value>
</ns0:entry>
</ns0:list>
Cheers,
Vlad
Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question. If you think this is helpful, please consider giving points -
I have a JVC video camera and it records the video to a .mod format (which Apple devices don't support). I figured out how to get them to iPhoto using iMovie but I want to be able to get the videos on my iPad 2 but it won't let it sync. Any help?
Thanks for that. Much more constructive than the last comment. It's only the restriction code I can't recall, not the access passcode. So I can currently access the device, just not age restricted content. Does that's make a difference? I also wondered if anyone knew how many attempts you get to try to get it right. Now tried 21 times and so far nothing bad has happened but I am concerned I'll eventually be completely locked out of the device. That doesn't seem in the spirit of things though. Surely it's foreseeable that a child could repeatedly try to guess the code so I can't see that it would be right to lock the device down completely in that circumstance, particularly if the access code is being typed in correctly every time.
Thanks -
How to select multiple records from a TREE in the table
HI,
I have a tree structure which is in the table.When I open the node of the tree,all the subnodes are coming as one-one records in the table.I want to slect multiple record from this table.I applied onLeadSelect for this table,I can select only 1 record from the table.
Can any one plz suggest me how to select multiple records from the table so that I can get all the data of those selected record.
Regards
-SandipRashmi/Kukku,
First of all, Thanks for your help!
Is there any other way in which we can access tables other than using BAPIs or RFCs?
In my case, there is a table structure which has to be updated with values after validating a key. i don't think there is any RFC available now. do i need to create bapi/rfc for that?
Krishna Murthy -
How to get multiple selected fields in list
Hello all,
I am trying to get multiple selected value from a list but i dont know how to get multiple selected fields from a list though AS3.
Actually i want to pass the selected fields to php, so for that i need to get the selections and send to php.
Thankx..i want to put the selected fields of list in an array through AS3....
actually......i figured it out how to do that...........
Its simple......use
list.selectedItems[index]
and to get the number of items selected......
list.selectedItems.length
simple..... -
How to get web application to use Tuscany without conflicting with SAP SDO
Hi,
We are attempting to run a web application on SAP NetWeaver CE 7.1 SP1 which uses Tuscany SDO. As it now stands We must use Tuscany because the web application will not run with the SAP SDO implementation provided by Netweaver. To ensure that Tuscany is loaded with priority, we have packaged the Tuscany JAR files and their dependencies as a heavy resource, as described here:
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60642a88-95fe-2b10-d387-a245d48fc257?overridelayout=true
The final check showed that Tuscany was correctly deployed as a heavy resource and included the following JAR files:
common-2.2.3.jar
ecore-2.2.3.jar
ecore-change-2.2.3.jar
ecore-xmi-2.2.3.jar
tuscany-sdo-impl-1.1.1.jar
tuscany-sdo-lib-1.1.1.jar
tuscany-sdo-tools-1.1.1.jar
xsd-2.2.3.jar
We also verified that the web application using Tuscany has a hard reference to the Tuscany heavy resource.
However, when we try to run the web application, the following error is logged: java.lang.LinkageError: Class commonj/sdo/DataGraph violates loader constraints
The issue is definitely due to some kind of classloading conflict with the SAP SDO library, as the application runs normally when SAP SDO is manually removed from the classpath. Doing this on a production system is unfortunately not an option, though.
So the question is: how to get web application to use Tuscany without conflicting with SAP SDO?I took a look at the "printerReady" example. Looks like I may be able to use the InetPing (...) function to ping through a range of IP addresses looking for a response.
Any ideas on how to find the MAC address associated with the IP addresses that respond?
We may have multiple units responding and the MAC address will allow the operator to determing which unit to connect to.
I'll try the InetPing to see how it works,
Kirk -
How to get default values while using the transaction "BP"
Hi Group,
I have a query on how to get default values while using the transaction <b>BP</b>?
The thing is:
when I enter into the transaction "BP", I need to see some default values to some of the input fields in the screen.
how can I achieve this?
So please kindly let me know the procedure to achieve this.
Thanks & Regards,
Vishnu.Hi,
The events of BDT can be used to default some fields on creating a partner.
For this create a function module for ISDAT. attach that event in BUS7.
In the ISDAT funtion modulethe following code should be used.
For example to set the nationality:
I_BUSDEFAULT-NATIO = 'DE.
CALL FUNCTION 'BUP_BUPA_FIELDVALUES_SET'
EXPORTING
i_busdefault = I_BUSDEFAULT
Regards, Smita. -
How to Add multiple entry to the group policy security filtering
How to Add multiple entry to the group policy security filtering
Is there any way we can add multiple entry to the Domain group policy Security filtering tab.Currently its not allowing to add more then one entry at a time.
Getting Error like "only one name can be entered,and the name cannot contain a semicolon.Enter a valid name"Hi
Are you trying to add more users or groups through Group Policy Management Security Filtering tab?
Try right clicking on the policy and then edit
Then in Editor Right click on the name of the policy and Properties
Security tab and add user or group from this tab. Just make sure if you are adding user or groups "Select this object type" has
the correct option also "From this Location" is set to your entire directory not the local server.
Update us with the above.
Thanks
Maybe you are looking for
-
Thread: 11gPS2 : Error creating model from wsdl while creating a WebService
Hi , I am trying to create a Web Service Proxy using Jdev.I am using a WSDL file located in my local system for the same. I choose all default options but the proxy is not created due to the following error - "Error creating model from wsdl <wsdl_nam
-
Got a short chapter that began life in Word and was placed into ID. It contains a 2-col table, one of those cols is full of Greek I'd prefer not to retype. On page 3 of the doc (the middle), text persistently shows as overset (that red plus sign).
-
Authorization checks in WDA View
Hi All, I have a single WDA Compnent having one View. This View has some buttons that only certain users should be allowed to access. So I need to carry out authorization checks in Backend. Can someone please give me an example of how to proceed on s
-
My iphone is lock i can't use sim card
my iphone is lock verssion i can't use sim card ,phone details as below IPHONE 4S 16 GB SERIAL NUMBER 7S037K1FA4S IMEI 012422006920617 COUNTRY LOCK ENGLAND
-
Error code older version of bonjour cannot be removed
I am getting the error code that an older version of Bonjour cannot be removed. How do I install the latest version of Itunes?