What is joins?where we use it. is it DD concept? abap
hi abapers,
what is joins?where we use it. is it DD concept?
regards,
anjan
hi srinivas.
chk this simple example.
u will get good idea.
table emp
empno name
a sasi
b xxx
c yyy
table sal
empno salary
a 1000
b 2000
Inner join
select eempno ename
s~sal
into table int_table
from emp as e
inner join sal
on
eempno = sempno.
if you made inner join between table a and b by emp no
the selection retrives only if the condition satisfy the output will be
a sasi 1000
b xxx 2000
Outer join
select eempno ename
s~sal into table int_table
from emp as e
LEFT OUTER JOIN sal
on
eempno = sempno.
if you made outer join (left /right ) the left table kept as it is the
if the condition satisfy the right table entries will fetch else leave it blank
the output will be
a sasi a 1000
b xxx b 2000
c yyy
rgds
anver
if helped mark points
Similar Messages
-
hi,
is there any criteria determining the usage of <b>inner join</b>, i.e no. of rows to be retrieved from the tables... can we avoid using <b>inner joins</b>...
i hope i have cleared my query.....
thanx in advance
abhishek suppalAbhishek,
Inner joins (when used correctly) are a GOOD thing.
The criteria as to when to use an inner join is that the tables must have common values. For example let's look at VBAK and VBAP. The both share VBELN as their common link. And becasue VBELN is part of their keys it is very good to use an inner join if you need data from both tables.
eg. We want to get sales Order data into TBL_SALESORDER from VBAK / VBAP
Without Inner Join you can do it something like this:
data: begin of tbl_vbak occurs 0,
vbeln like vbak-vbeln,
kunnr like vbak-kunnr,
audat like vbak-audat,
end of tbl_vbak.
data: begin of tbl_vbap occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
matnr like vbap-matnr,
zmeng like vbap-zmeng,
end of tbl_vbap.
data: begin of tbl_salesorder occurs 0,
vbeln like vbak-vbeln,
kunnr like vbak-kunnr,
audat like vbak-audat,
posnr like vbap-posnr,
matnr like vbap-matnr,
zmeng like vbap-zmeng,
end of tbl_salesorder.
data: l_index like st-tabix.
select vbeln kunnr audat
into table tbl_vbak
from vbak.
check sy-subrc eq 0.
select vbeln posnr matnr zmeng
into table tbl_vbap
from vbap
for all entries in tbl_vbak
where vbeln = tbl_vbak-vbeln.
check sy-subrc eq 0.
sort tbl_vbap by vbeln posnr.
loop at tbl_vbak.
read table tbl_vbap with key vbeln = tbl_vbak-vbeln
binary search.
if sy-subrc eq 0.
l_index = sy-tabix.
loop at tbl_vbap from l_index.
if tbl_vbak-vbeln ne tbl_vbap-vbeln.
exit.
endif.
clear tbl_salesorder.
move-corresponding tbl_vbak to tbl_salesorder.
move-corresponding tbl_vbap to tbl_salesorder.
append tbl_salesorder.
endloop.
endif.
endloop.
With an inner join you can do it like this:
data: begin of tbl_salesorder occurs 0,
vbeln like vbak-vbeln,
kunnr like vbak-kunnr,
audat like vbak-audat,
posnr like vbap-posnr,
matnr like vbap-matnr,
zmeng like vbap-zmeng,
end of tbl_salesorder.
select vbak~vbeln vbak~kunnr vbak~audat
vbap~posnr vbap~matnr vbap~zmeng
into table tbl_salesorder
from vbak
inner join vbap
on vbak~vbeln = vbap~vbeln.
In the above example it is more efficient to use the inner join because we hit the database once. Without the inner join we hit the database twice (once for the VBAK info and the other time for the VBAP info).
If you want to restrict the data you canuse a select option or parameter like any other SELECT statement. What you probably would not do is use the "UP TO X ROWS" clause as this will essentially limit the data from VBAP not VBAK.
I know that this example is a very simple one and we were luck to be able to "join" the tables using their primary keys. If the "join" between the tables are not by their primary keys or by an index then you may need to reconsider using an inner join and this will cause performance problems.
I hope this makes some sense. Let me know if you need more info, alternatively take a look at the SAP Help (F1) for SELECT.
Cheers,
Pat.
PS. Kindly assign Reward Points to the posts you find helpful. -
What is Prtitioning Where we use this?
I want to know about Partitioning?
WNavigation:
Goto infocube change mode ->Extras menu->DB performance-> Partitioning.
Usage,Pros and Cons:
It is the logical partition of the data of the cube and it refers to creation of blocks according to time characteristics(0CALMONTH,OFISCPER) available in the target. So that Cube Partitioning will improve the Data Load performance. It also improve performance in reporting.
Partition is usefull for improving performance of query. once u create partition data load on that particular cube is divided depends upon how many partition u've created.
For complete info check out this link:
[PARTITIONING...|http://help.sap.com/saphelp_nw04s/helpdata/en/33/dc2038aa3bcd23e10000009b38f8cf/content.htm] -
What is use of ejbPostCreate(), what it returns, where exactly can it be in
what is use of ejbPostCreate(), what it returns, where exactly can it be invoked?
Why don't you try reading or googling or something, rather than asking every question that pops into your head?
-
What is JDK? Where we use JDK?
What is JDK? Where we use the JDK? IS it JAVA related?
It's not that stupid a question. I mean, if you were a developer, but had never used Java before, why would you automatically know the differences between the JDK, JRE, SDK, J2SE, Java 5, J2EE, etc. ?
I know when I first investigated J2EE I had vaguely assumed that it would include the development tools.
Until you dive into the tutorials it's not explained very clearly what the distinctions are. Even now Sun tend to use some internal acronyms which aren't clearly defined anywhere (don't get me started about "FCS").
I'd be a lot more sympathetic to the cause of marketing idiocy (see Java and Solaris/SunOS version numbering) if they managed to make the names clearer, instead of confusing potential new customers.
But hey, what dos that matter so long as it goes to 11?
No, the OP is just asking in a really dumb place... -
What happens u0093Updateu0094 command is used without where clause ?
Hi
What happens Update command is used without where clause ?
thank youHi subash,
chk this help
UPDATE dbtab SET f1 ... fn. or
UPDATE (dbtabname) SET f1 ... fn.
Extras:
1. ... WHERE condition
2. ... CLIENT SPECIFIED
3. ... CONNECTION con
Effect
Updates values in a database table. <b>If there is no WHERE clause, all lines (in the current client) are updated.</b> If a WHERE condition is specified, only thoserecords which satisfy the WHERE condition are updated. -
What is performance optimizaion in bods ?? where we use ??
what is performance optimizaion in bods ?? where we use ??
Dear
for increasing performance in BODS
Some tips for fine tuning the BODS job for faster and efficient executions with optimal resource utilizations.
Regards -
What is info type 1957 and where its used?
What is info type 1957 and where its used?
I have used this infotype.
check out this link
P1957 Infotype 1957 - Obsolete, DO NOT USE - SAP Structure - ABAP -
This week the keypad "jumped" to the top of the screen so that I often can't see what I'm typing! Not sure why it happened and want to know how to get the keypad back down to where it used to be! Can anyone help?
Cheers
FreddyIf the keyboard is split and covering your text, Pull the two ends of the keyboard together - into the middle of the screen. You can also tap and hold down on the little keyboard icon in the lower right corner of the keyboard and select - Dock and Merge.
If the keyboard is up on the middle of the screen, but not split, and you want to move it back to the bottom - tap and hold down on the little keyboard and icon and select - Dock
You can turn the split keyboard off in Settings>General>Keyboard>Split Keyboard>Off. -
Oracle BI what is cubes and dimention and where we use cubes and dimention
Dear ,
I am working on Oracle BI.
what is cubes and dimentionS and where we use cubes and dimention
Please give a link where i get stuff regarding cubes and dimentions.
thanksPossibly you are lost in the wrong forum category ...
Post your query in:
Hyperion EPM -
WHAT IS DELTA JOB IN BODS ?? WHERE WE USE DELTA JOBS ??
WHAT IS DELTA JOB IN BODS ?? WHERE WE USE DELTA JOBS ??
There is no 'Delta Job' object in Dataservices, In any ETL tool if you are loading data in incremental way based on certain conditions (Ex: Extract only yesterday's changed data and load), then its a Delta load, the Job which does this, you may call Delta Job.
Please don't use ALL CAPS, its like yelling in forum -
How to tell what methods where not used in the code?
Hi there,
I wonder if there's a way to check what method are not used in the execution code (void main).
Example:
in the code below, the following method where not used:
setAge, getAge, getName,setName, addFeedback
public class Test
public static void main(String args[])
Employee empl = new Employee("John", 54);
System.out.println(empl.getDeatils());
public class Employee
private int age;
private String name;
public Employee(String name, int age)
this.name=name;
this.age=age;
public String getDeatils()
return name+" ("+age+")";
public void addFeedback()
//do something here.
public int getAge()
return age;
public void setAge(int age)
this.age = age;
public String getName()
return name;
public void setName(String name)
this.name = name;
}Yucca wrote:
georgemc wrote:
Yucca wrote:
Sound like you should visit the logging API or you could do SOP all over your code which would make it very unreadableI don't see why logging code will make his code any less messy than SOP everywhere. Unless you're talking about applying logging by AOP, which is equally messy in a different way.I never implied that the one was tidier than the other. O merely recommended my knowledge on how to help the OP and gave 2 choices. Oh right. It looked like you were suggesting SOP was messier somehow. Never mind, then.
Besides is AOP really that bad when using Interceptors? I know that this is new to Java but interceptors are really not that untidy.I didn't say they were untidy. I didn't say there was anything wrong with AOP. But logging by AOP results in pretty useless, messy logs. "This method was called with these parameters" all over the place, rather than something nice and friendly. Remember, logging is more often read by support staff than developers, so while it might be obvious to you what "getLlama(200, 3)" means, it's probably garbage to the support bods. -
What flash player do l use for my lpad and where can l get it ?l want to play online games
what flash player do l use for my lpad ? to play online games
Some Facebook games, for example, Farmville, have their own iPad apps.
Check the App Store to see if the games which you play have an App. -
My ipod touch just keeps searching for a wi-fi connection in my house where it use to connect automatically. My other apple devices still are connecting so not the wi-fi. I have reset to original settings, turned off-on-off-on... nothing seems to work. Does anyone have any ideas?
Thanks!Does the iPod connect to other networks?
Does the iPod see the network?
Any error messages?
Do other devices now connect?
Did the iPod connect before?
Try the following to rule out a software problem:
- Reset the iOS device. Nothing will be lost
Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Power off and then back on the router
- Reset network settings: Settings>General>Reset>Reset Network Settings
- iOS: Troubleshooting Wi-Fi networks and connections
- Wi-Fi: Unable to connect to an 802.11n Wi-Fi network
- iOS: Recommended settings for Wi-Fi routers and access points
- Restore from backup. See:
iOS: How to back up
- Restore to factory settings/new iOS device. (I think you did this)
If still problem make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
Apple Retail Store - Genius Bar -
Hi Gurus,
I have three tables. I want to join all tables using union in SQL statement. The query is returning all the records from both tables but i only require unique rows based on a specific column value. Here is my table structure -
TableA -
LIC_ID NUMBER(10) NOT NULL
LIC_NUMBER VARCHAR2(20)
COMMENCE_DATE DATE
EXPIRY_DATE DATE
TERM VARCHAR2(20)LIC_ID is the primary key in this table -
Sample data from TableA
LIC_ID LIC_NUMBER COMMENCE_DATE EXPIRY_DATE TERM
2 TR4323 12/04/2008 11/03/2010 2 Years
34 TR5432 23/07/2009 22/07/2010 1 Year
45 TR5321 24/06/2009 23/06/2010 1 Year
65 TR6666 23/07/2010 22/07/2011 1 Year
32 TR2423 30/05/2010 29/05/2011 1 YearTableB -
MAR_ID NUMBER(10) NOT NULL
LIC_ID NUMBER(10) NOT NULL
ZONE_NAME VARCHAR2(20)
DEPARTMENT VARCHAR2(20)
ACTIVITIES VARCHAR2(200)
COMMENTS VARCHAR2(200)MAR_ID is the primary key in this table and LIC_ID is the foreign key on TableA
Sample data from TableB -
MAR_ID LIC_ID ZONE_NAME DEPARTMENT ACTIVITIES COMMENTS
23 2 ZONE A IT NONE
43 34 ZONE B IT NONE
33 65 ZONE C ACCOUNT NONE
TableC
REC_ID NUMBER(10) NOT NULL
LIC_ID NUMBER(10) NOT NULL
DIST_NAME VARCHAR2(20)
REGION VARCHAR2(20)
ACTIVITIES VARCHAR2(200)
COMMENTS VARCHAR2(200)REC_ID is the primary key in this table and LIC_ID is the foreign key.
Sample data -
REC_ID LIC_ID DIST_NAME REGION ACTIVITIES COMMENTS
2 45 SA NORTH NONE
3 65 TA NORTH NONE
5 32 NT SOUTH NONEHere is my sql query -
select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
TableA a, TableB b
where a.lic_id=b.lic_id
union
select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
TableA a, TableC c
where a.lic_id=c.lic_idThe above query returns -
lic_id lic_number commence_date expiry_date
2 TR4323 12/04/2008 11/03/2010
34 TR5432 23/07/2009 22/07/2010
45 TR5321 24/06/2009 23/06/2010
65 TR6666 23/07/2010 22/07/2011
32 TR2423 30/05/2010 29/05/2011
65 TR6666 23/07/2010 22/07/2011 LIC_ID 65 exists in both table TableB and TableC hence it repeats in query but I want to display that only once. How can I do that? I want to return unique record on LIC_NUMBER.
Hope this make sence.
Many thanks,
TajuddinThanks for all your reply and suggestions. David altering session did not work.
Sven your idea helped me to figure it out what to do. I found a way around to fix it. Here is my current code -
select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
TableA a, TableB b
where a.lic_id=b.lic_id
union
select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
TableA a, TableC c
where a.lic_id=c.lic_id and c.lic_id not in ( select lic_id from TableB)This will exclude any LIC_ID exists in TableB.
Thanks again for your help guys.
Regards,
M Tajuddin
Web: http://tajuddin.whitepagesbd.com
Blog: http://aspblog.whitepagesbd.com
Maybe you are looking for
-
My Iphone 4S isn't recognized by itunes when i connect it via usb...it won't sync.
-
Can get mail but can not receive mail.
Had a problem with receiving mail on an account so we deleted the account and re-added it. And it worked. Same thing is now happening to another user ad we tried the same thing but the user is still not getting mail. Running 10.4.10. any help would b
-
File to Idoc - EOF issue.
Hi, I am working on file to IDoc scenario. But facing a problem... The source file contains ..EOF.. as a last line in the file. Actually, there is no need to map it to any of the field in IDOC. Just I have created a element in the source data
-
I gave my iphone for servis and the sailman return to me another one that has been used, without giving more details, telling me that this is the way apple does business. IS THAT TRUE?
-
Hi after I opened a Excel Report (New Report.vi) I can edit and save it without any problems. The problem I have now, is that I don't know how to EXIT Excel after editing. The New Report.vi only gives back a "report out" reference. which I can't use