How to get data from three tables (A,B,C) having one to many relation between A and B .and having one to many reation between b and c
i have three tables A,B,C. there is one to many relation between A and B. and one to many relation existed between table b and c . how will get data from these three tables
check if this helps:
select * --you can always frame your column set
from tableA a
left join tableB b on a.aid=b.aid
left join tableC c on c.bid=b.bid
This is just a general query. However, we can help you a lot more, if you can post the DDL + sample data and required output.
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>
Similar Messages
-
How to get data from a table in a condition between twomonth
hai friends
I have a query that is i want to get data from a table based on a condition between two months in a format of char column
Ex
I have a column called from_month in the format of 'mon/yyyy'(already converted from date')
then the second column is to_month in the same format 'mon/yyyy'
now i wiil select from_month and to_month like
from month jan/2009
to month mar/2010
how to use between of two months in the format of char.Please tell me how to get two different month between data.Hi,
This may be of help.
Remember Pointless has made a point ;) (worth millions)
If possible , DO NOT store dates as strings or numbers.Let dates be dates.
WITH dat AS
(SELECT ' THIS IS JAN' x,to_char(to_date('01-JAN-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS FEB' x,to_char(to_date('01-FEB-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS MAR' x,to_char(to_date('01-MAR-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS APR' x,to_char(to_date('01-APR-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS MAY' x,to_char(to_date('01-MAY-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS JUN' x,to_char(to_date('01-JUN-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS JUL' x,to_char(to_date('01-JUL-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS AUG' x,to_char(to_date('01-AUG-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS SEP' x,to_char(to_date('01-SEP-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS OCT' x,to_char(to_date('01-OCT-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS NOV' x,to_char(to_date('01-NOV-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual)
SELECT * FROM dat
WHERE to_date(y,'mon/yyyy') BETWEEN to_date('01 jan 2009','dd mon yyyy') AND to_date('01 mar 2009','dd mon yyyy')Cheers!!!
Bhushan -
How to get data from COSP table, field HRKFT as the key to data from PM?
Dear ladies and gentlemen!
I need to get data from COSP table, field HRKFT as the key to data from PM tables (AFKO and AUFK).
The problem is that it is a key field to the COSP, and all non-key fields as an alternative to HRKFT are not suitable for this task.
All this is necessary for the extractor, which loads the data from the R \ 3 systems in the BW-system. I need to perform SELECT from a table COSP and maybe also JOIN, most likely between tables COSP and AUFK.
What should I do in this case?
Thank you very much in advance!From information on help.sap.com I've made a conclusion that one of possible solutions in theory is to modify standard extractor PM_OM_OPA_1 in order to make HRKFT field available for work, because by default it is hidden by SAP and not available for use as a key field.
Of course, it's not a very good solution, but for now I know no other way to solve this problem.
Maybe someone knows better ways? In this case I will be very grateful for any help!
Moderator: You'd better post it on BI forums -
How to get data from large table (more than 9 million rows) by EJB?
I have a giant table, it has more than 9 million rows.
I want to use ejb finders method to get data from this table but always get not enough memory error or time out error,
Can anyone give me solutions?
ThxYour problem may be that you are simply trying to load so many objects (found by your finder) that you are exceeding available memory. For example if each object is 100 bytes and you try to load 1,000,000 objects thats 100Mb of memory gone.
You could try increasing the amount of memory available to OC4J with the appropriate argument on the command line (or in the 10gAS console). For example to make 1Gb available to OC4J you would add the argument:
-Xmx1000m
Of course you need have this available as hard memory on your server or you will incur serious swapping.
Chris -
How to get data from multiple tables
Hello Everyone,
I need to read data from a few tables (VBAK, VBAP, VBUK, VBUP etc.) because I'd like to get all open Sales Orders. I've tried to use RFC_READ_TABLE but it looks like it can read only 1 table at a time. I've tried to read data from individual table and then join them but it didn't work out very well because I got about 1.5 millions records from just the VBUP table. So anyone knows if there is any function that I can use to join those tables and just get the records I need?
Any help would be highly appreciated.Hi Nhan,
Thank you for your reply.
Do I have to be a SAP developer to create BAPI on SAP? What kind of access rights do I need?
I've tired to use other BAPIs such as BAPI_SalesOrder_GetList and it doesn't work for me because I don't have all customer numbers and I need to get all un-shipped orders for all customers.
I've read a post on the internet brieftly menitoned that we can create a table to store information about the tables we want to join and then call the RFC_READ_TABLE function. Do you know if that is possible?
Is there any other way you can think of? -
OC4J - How to get data from large table (more than 9 million rows) by EJB?
SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS
O I use Jdeveloper to create EJB that has finder methods to get data from a big table (more S than 9 million rows). Deploy is OK but when run client program I always get timeout
O error or not enough memory error,
S Can any one help me?
O urgent
SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOSYour problem may be that you are simply trying to load so many objects (found by your finder) that you are exceeding available memory. For example if each object is 100 bytes and you try to load 1,000,000 objects thats 100Mb of memory gone.
You could try increasing the amount of memory available to OC4J with the appropriate argument on the command line (or in the 10gAS console). For example to make 1Gb available to OC4J you would add the argument:
-Xmx1000m
Of course you need have this available as hard memory on your server or you will incur serious swapping.
Chris -
How to get data from the Tables (Can func.module help then how to write )
Hi,
Can anyone tell the use of functional module to extract the data from R/3.i am working on PM module and need to extract the status of work order and equipment which i can get from First i had to get objnr then i had to go to jsto in jsto i get stsma and estat. by using estat and stsma i can get status in table tj30t here estat is same as stat in jest table.
how to get all these in bw . any help.
I need status of work orders and equipments which exists in tj30t or we can get from tj30 tables in the fields txt30 and txt04
Any one pls help to get all these stuff from R/3 to BW
Regards
Srini-----Hi
You need to enhance (write a user exit) for your Data Source.
Here are some links on UE:
Enhancment Framework
====================
SAP Help Enhancment Framework
http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
Enhancements in sap bw
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/59069d90-0201-0010-fd81-d5e11994d8b5
User Exit Enhancments
Enhancement
User exit
BADI
http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
Reg's
Edan -
Getting data from three tables
I have 3 tables
SQL> select * from t1;
C1
d1
d2
SQL> select * from t2;
C1 C2
d1 g1
d1 wf1
d2 g2
d2 wf2
SQL> select * from t3;
C2 C3
wf1 open
wf1 closed
wf1 closed
wf1 cancelled
wf2 closed
wf2 cancelled
wf2 closed
I would like to join rows from t1 and t2 for no t3.c3='open' ie the result I want is:
C1 C2
d2 wf2
d2 g2
ThanksAm afraid, if you look at it logically from your table structure, you can see you only have one data open. So the result you expected to get as stated is wrong.
I believe this is the correct answer
SQL> select a.c1, b.c2, c.c3 from t1 a, t2 b, t3 c where a.c1 = b.c1 and b.c2 = c.c2 and c.c3 = 'ope
n' order by 1;
C1 C2 C3
d1 wf1 open
Cube60 -
How to Get Data From E070 table From Asp
HI,
I am New to ALE, IDOC and BAPI Programming,
I am just trying to fetch data from SAP through custom interface viz ASP.
How to Do this.. Can anyone help me
Regards
GuhapriyanHi,
You will need some sort of a connector to fetch data from SAP using SAP. DCOM connector has been provided by SAP to fulfill this task. Please take a look at the documentation for DCOM connector. You can download latest version and documentation from service.sap.com/connectors.
Regards -
How to get data to internal table from function module tr_inspect_objects
How to get data from funtion module to an internal table .
function module name is tr_inspect_objects(code inspectore se10)
how top collect all task request data into one internal table using this fm or we have to create another fm .
If you have already made FM please give us the code .Hi,
You can use tables E070 or E071 to get data into your internal tables instead of a function module.
Hope this helps.
BR
Dep -
Jdbc getting data from multiple tables
hi guys
how can i get data from multiple tables in MSAccess
please help>
here is code thata i want to do
i have 3 tables in my MSAccess databace
Stud_O which consist name,surname fields
Stud_I consist address,tel
Stud_E department,faculty fields
Based on this I would guess that you are missing a key field. There is no way to connect the tables.
I make the class to insert data to the tables. But
cant do getting datas from this tables.
can anybody help me in making query
and method that displays reultset strings to the
textBoxes
A select ...
select name,surname from Stud_O. Use the executeQuery() method. -
I am converting a servlet based application to struts framework.I have a screen which gets data from 7 tables.I cannot use a stored procedure so has to manage using SQL queries.I thought i will query each table and set it to my struts form.The screen has lot of drop down boxes .
I have heard of composite design pattern .Please let me know the best way to query the tables.Here are the queries.
Select a.proj_id , a.proj_nm
From stn_proj_et a, stn_proj b
Where a.proj_id = b.proj_id
And a.sftwr_id = 24
And b.stn_id = 56602;
Select round(utm_x,3) utm_x, round(utm_y,3) utm_y, stn_id
From stn_loc_hist
Where stn_id ='56602'
And cur_use_cd = 1
select data_tp_cd
from data_coll_summ
where stn_id ='56002'
And rownum < 2;
select lat_no,long_no,pnt_loc_dsc,srce_id,mthd_dtrmn_cd,ctrl_dtm_cd
from stn_et
where stn_id = '56002';
select
distinct sjr_utils.getcatalogvalue(mthd_dtrmn_cd)
from stn_et;
select
distinct sjr_utils.getcatalogvalue(ctrl_dtm_cd)
from stn_et;
select distinct PROJ_NM from stn_proj_et where sftwr_id=24;
Select a.stn_alias_nm stn_alias_nm, b.alias_orgn_nm alias_orgn_nm
From stn_alias_nm a, alias_orgn_et b
Where a.alias_orgn_id = b.alias_orgn_id
And b.alias_orgn_tp = 0
And stn_id = '56002';adithiananya wrote:
I am converting a servlet based application to struts framework.How well do you know Struts?
I have a screen which gets data from 7 tables.I cannot use a stored procedure so has to manage using SQL queries.I thought i will query each table and set it to my struts form.The screen has lot of drop down boxes .You don't need a stored procedure to query a database.
I have heard of composite design pattern .This ain't it.
Please let me know the best way to query the tables.Here are the queries.
Select a.proj_id , a.proj_nm
From stn_proj_et a, stn_proj b
Where a.proj_id = b.proj_id
And a.sftwr_id = 24
And b.stn_id = 56602;What are those hard-wired magic numbers in the WHERE clause?
>
Select round(utm_x,3) utm_x, round(utm_y,3) utm_y, stn_id
From stn_loc_hist
Where stn_id ='56602'
And cur_use_cd = 1What are those hard-wired magic numbers in the WHERE clause?
>
select data_tp_cd
from data_coll_summ
where stn_id ='56002'
And rownum < 2;What are those hard-wired magic numbers in the WHERE clause?
>
select lat_no,long_no,pnt_loc_dsc,srce_id,mthd_dtrmn_cd,ctrl_dtm_cd
from stn_et
where stn_id = '56002';
select
distinct sjr_utils.getcatalogvalue(mthd_dtrmn_cd)
from stn_et;
select
distinct sjr_utils.getcatalogvalue(ctrl_dtm_cd)
from stn_et;
select distinct PROJ_NM from stn_proj_et where sftwr_id=24;What are those hard-wired magic numbers in the WHERE clause?
Select a.stn_alias_nm stn_alias_nm, b.alias_orgn_nm alias_orgn_nm
From stn_alias_nm a, alias_orgn_et b
Where a.alias_orgn_id = b.alias_orgn_id
And b.alias_orgn_tp = 0
And stn_id = '56002';What are those hard-wired magic numbers in the WHERE clause?
Do you really want to execute different requests given input from the users? (e.g., enter a value in a text box and see the drop down list boxes change)
% -
How to copy data from transparent table to our own ceated z table?
How to copy data from transparent table to our own ceated z table?
Plz tell me different methods and which one is best?
Is get data from sflight into table z* is correct?Hi Ajay,
let us consider you have to copy EKKO table to ZEKKO table
1. In ABAP program define internal table based on EKKO
<b> eg: i_ekko</b>
2. Select the data from EKKO to i_ekko
<b> eg: select * from ekko into table i_ekko.</b>
3. insert into Z-TABLE from the internal table
<b> eg: INSERT EKKO FROM TABLE I_EKKO.
COMMIT WORK.</b>
<u>To insert in internal table you can use the following:</u>
1. INSERT [wa INTO|INITIAL LINE INTO] itab [INDEX idx].
2. INSERT [wa INTO|INITIAL LINE INTO] TABLE itab.
3. INSERT LINES OF itab1 [FROM idx1] [TO idx2] INTO itab2 [INDEX idx3].
4. INSERT LINES OF itab1 [FROM idx1] [TO idx2] INTO TABLE itab2.
<u>To inert in database table, use the following:</u>
1. INSERT INTO <dbtabname> [CLIENT SPECIFIED] VALUES wa.
2. INSERT <dbtabname> [CLIENT SPECIFIED] FROM TABLE itab.
3. INSERT <dbtab> [CLIENT SPECIFIED]. oder
4. INSERT <dbtabname> [CLIENT SPECIFIED] ... .
<b>Reward points.. if helpful.
Cheers !
Moqeeth.</b> -
How to send data from internal table to the shared folder in ABAP
Hi experts,
My requirement is to transfer data from a file to shared folder. i just did reading data from a file to a internal table. Now i want to send this internal table data into a shared folder which is "
xxx\y\z....".
I do not have any idea on how to send data from internal table to the shared folder path.
can anybody please help me out how to do this?
Thanks & Regards
Sireesha.Where that folder is located, its on presentation server i.e. desktop or application server.
If its on presentation server, use FM GUI_UPLOAD.
If its on application server, then use DATASET functions. Have a look at below link.
[File Handling in ABAP|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm]
I hope it helps.
Thanks,
Vibha
Please mark all the useful answers -
How to retrieve data from plsql table in BI publisher Data template
Hi All,
I have created a data template for XML publisher report. In data template i m getting data from plsql table. for that i have created one package with pipelined function. I am able to run that sql from sql developer .But if i run the concurrent program then i got error like "java.sql.SQLSyntaxErrorException: ORA-00904: "XXXXX": invalid identifier".
I have used the same parameters in Data template and concurrent program....
please clarify me what needs to be done....
thanks in advance....
Regards,
DossHi Alex ,
i am using pipelined function and get the data from cursor and load it into plsql table (nested table). and i use the below in my data template to fetch the data:
<sqlStatement name="Q1">
<![CDATA[select * from table(PO_SPEND_RPT_PKG.generate_report(P_ORG_ID,P_SOB_ID,P_ORG_NAME,P_PERIOD_NAME,P_CLOSE_STATUS,P_E_PCARD_NEED,P_REPORT_TYPE))]]>
</sqlStatement>
if i run the above in sql developer i can get the result....from apps if i run i got the error "java.sql.SQLSyntaxErrorException: ORA-00904: "P_ORG_ID": invalid identifier"
Edited by: kalidoss on Sep 14, 2012 4:32 AM
Maybe you are looking for
-
I have a problem in activate Alaaclaud account and I can not open the device
السلام عليكمI have a problem in activate Alaaclaud account and I can not open the device
-
I have an editable pdf (created using Acrobat 9).Is it possible to lock an editable pdf using Reader, but then unlock the same pdf (in Reader) at some stage in the future? The users of this pdf will only have Reader available to them. Once the edit
-
Hi, After Receipt of Bill of lading. BOD is in INR.Our po is in forgine currancy .How to do invoice verification. Regards, Vivek
-
I have a denon receiver with hdmi, but it only supports sound thru av cables, is there an av adapter for Apple TV? Any other options on how I connect my apple tv to my receiver to get sound? Thnaks
-
Is there a way to see the full title names of videos?
I have various videos on my iPhone, unfortunately they have long titles and I'm unable to see the full names when making a selection of which one to play.