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 * with JOIN statment

Former Member
0 Likes
449

Hi,

I'm joining two tables with SQL, the problem I want to write * from writing all the fields

what I do like this

SELECT Z* T* FROM table1 AS Z INNER JOIN Tbale2 AS T ON Zx = Ty

how do I write this ?? without getting error for Z* and T*

Thx

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
412

Hi,

If you want to use all fields of both tables use it as follows:-

TYPES:BEGIN OF ty_mat,

include TYPE mara.

INCLUDE TYPE makt.

types:END OF ty_mat.

data:t_mat type standard table of ty_mat.

then use select * from table1 and table 2 as your doing now.

Alternatively u can use this:-

SELECT * FROM X INTO TABLE T_TABLE1.

SELECT * FROM Y INTO TABLE T_TABLE2

FOR ALL ENTRIES IN T_tABLE1

WHERE p = T_TABLE1-Q.

Edited by: Subhashini K on Nov 2, 2009 5:25 PM

2 REPLIES 2
Read only

ThomasZloch
Active Contributor
0 Likes
412

Just write SELECT * FROM ...

Thomas

Read only

Former Member
0 Likes
413

Hi,

If you want to use all fields of both tables use it as follows:-

TYPES:BEGIN OF ty_mat,

include TYPE mara.

INCLUDE TYPE makt.

types:END OF ty_mat.

data:t_mat type standard table of ty_mat.

then use select * from table1 and table 2 as your doing now.

Alternatively u can use this:-

SELECT * FROM X INTO TABLE T_TABLE1.

SELECT * FROM Y INTO TABLE T_TABLE2

FOR ALL ENTRIES IN T_tABLE1

WHERE p = T_TABLE1-Q.

Edited by: Subhashini K on Nov 2, 2009 5:25 PM