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

Global select query

Former Member
0 Likes
691

hi,

I have custom table tab1 with fields V1, V2,V3.

V1 v2 are the mandatory fileds.

these V1 V2 are also existing in another table say tab2 along with addtional fields say V4, V5,V6.....etc.

On the basis of V4 How can I fetch V3.

Common fileds in tab1 and tab2 are V1 and V2.

in

Can anybody provide some sample statement for this.

Thanks

hi,

I have custom table tab1 with fields V1, V2,V3.

V1 v2 are the mandatory fileds.

these V1 V2 are also existing in another table say tab2 along with addtional fields say V4, V5,V6.....etc.

On the basis of V4 How can I fetch V3.

Common fileds in tab1 and tab2 are V1 and V2.

in

Can anybody provide some sample statement for this.

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
646

in tab2 V4 is key filed and tab1 V1 and V2 are key fields

I need fetch V3 on the basis of V4.

Read only

Former Member
0 Likes
646

since in tab2 V4 is key field and V1 & V2 are not, so for each V4 u can get multiple V1 and V2.

select V1 V2 from tab2 into table t1 where V4 = <some value>

select V3 from tab1 into table t2 for all entries in t1 where V1 = t1.V1 and V2 = t1.V2.

"where t1 is type having only V1 and V2 and t2 will be having only V3,

Read only

Former Member
0 Likes
646

Please SEARCH in SCN before posting basic questions.

Read only

Former Member
0 Likes
646

Try using the concept of

 FOR ALL ENTRIES