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

Select statement

Former Member
0 Likes
721

HI Experts,

I want to read data from 2 tables. There is no relation between the tables. One is user-defined table. I am trying with the inner joins but getting an error. How can I write the Select statement for these two tables?

Thanks & Regards

Rajendra

8 REPLIES 8
Read only

Former Member
0 Likes
692

if there is no link then you have to fetch the data in two select staement in two itab but after that how can you process and what is the requirement i dont know.

regards

shiba dutta

Read only

Former Member
0 Likes
692

Hi Rajendra Prasad,

If there is no relation between the two tables, it is not possible to join them(Or even if it is possible, it doesn't make any sense ..does it?).

There must be atleast one common field between the two tables, then only you can join them.

Regards,

Ravi

Read only

Former Member
0 Likes
692

Hi,

look for a third table which is having the common field

if you wish, send the tables i will try to find the relation.

Regards

Shiva

Read only

former_member188827
Active Contributor
0 Likes
692

u'll hav to use two select statements for fetching data but da results can b stored in 1 internal table.

Read only

Former Member
0 Likes
692

Hi Rajendra,

If there is no any common field between the two tables you can not write joins. In that case you will have to select data using two select statements. For more details please let me know the fields in two tables.

Read only

Former Member
0 Likes
692

Hi,

U can select using joins when there is a common primary key between them, only then the data will be correct and consistent,,.,,... but it depends on the requirement..

As u r saying that thers no relation....

First select one table data into an internal table ..say itab1...

Then use FOR ALL ENTRIES to select data from the other table..

This is a good approach...

CHeers

Rajiv

Read only

Former Member
0 Likes
692

for fetching data from 2 tables u need to have some sort of field which is similar in both the tables. without this the reporting is incomplete. specify the tables which ur using and if standard table no problem but if it is a custom table, specify even the fields and data elements been used so that the link can be specified.

Read only

Former Member
0 Likes
692

Hi,

use two different select statement.

reward if useful.