Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

joins

Former Member
0 Likes
1,581

how can i fetch data from 3 tables with <b>a single select statement without using joins</b>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,545

hi,

<i>Use Database View</i> (SE11)

Database views are implement an inner join, that is,

only records of the primary table (selected via the join operation)

for which the corresponding records of the secondary tables also exist are fetched.

Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set.

In database views, the join conditions can be formulated using equality relationships between any base fields.

In the other types of view, they must be taken from existing foreign keys.

That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys.

<u>

Creating Database View:</u>

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed06446011d189700000e8322d00/content.htm

Regards

Reshma

how can i fetch data from 3 tables with <b>a single select statement without using joins</b>

12 REPLIES 12
Read only

Former Member
0 Likes
1,545

create a datbase view in se11 with those three tables and now select the data by using single select statement from that view.

regards

shiba dutta

Read only

Former Member
0 Likes
1,545

hi Samuel,

Create a database <b>view </b>with all the three tables via SE11 and use that view in your select statement

Regards,

Santosh

Read only

Former Member
0 Likes
1,546

hi,

<i>Use Database View</i> (SE11)

Database views are implement an inner join, that is,

only records of the primary table (selected via the join operation)

for which the corresponding records of the secondary tables also exist are fetched.

Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set.

In database views, the join conditions can be formulated using equality relationships between any base fields.

In the other types of view, they must be taken from existing foreign keys.

That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys.

<u>

Creating Database View:</u>

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed06446011d189700000e8322d00/content.htm

Regards

Reshma

Read only

0 Likes
1,545

bu the view also contains joins is there no other way to do it

Read only

0 Likes
1,545

hi Samuel,

I guess this is the only way as per your requirement .....

Regards,

Santosh

Read only

0 Likes
1,545

Hi samuel,

I already answered your query

No there is no other way to get data from 3 tables in one select statement.

Regards,

Atish

Read only

0 Likes
1,545

thank for u r answer

Read only

Former Member
0 Likes
1,545

Hi Samuel

Create a database view(SE11) and select those particular fields from the 3 tables and use select statement from the view

if it is helpful please reward points,

Regards,

Azhar

Read only

Former Member
0 Likes
1,545

hi,

u can use view for it for even for all entries statement.

if helpful reward some points.

with regards,

Suresh Aluri.

Read only

Former Member
0 Likes
1,545

Hi Samuel,

There is a just workaround for it and it is also internally a JOIN :).

You need to create a DB view on there 3 tables.

Regards,

Atish

Read only

Former Member
0 Likes
1,545

samuel

u create a view and use it as a single table

if ur view is view1

then use

select * from view1.

i think they is no other way for ur requirement

Regards,

Azhar

Read only

Former Member
0 Likes
1,545

<b>Hi Samuel,

The only way is to create a projection view of 3 database tables and slect records from that VIEW.

regards

Debjani</b>