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

Issue with inner join

Former Member
0 Likes
376

I have 2 tables z1 and z2

z1 has f1 ,f2 and f3 fields with f1 and f2 as primary keys

and z2 has f4, f2,f3 and f5 fields with f4 and f2 as primary keys

I have to get f5 value. I have f1 and f2 values as my input

I am retreiving f3 value from z1 based on f1 and f2 and i am using retreived value of f3 from z1 and f2 on z2 to get f5 value

ex :

1 a b 9

2 a b 9

3 a b 8

4 a b 9

DATA : test LIKE z2.

clear test.

sELECT single bf4 bf2 bf3 bf5

INTO test

FROM z2 AS b INNER JOIN z1 AS a

ON bzf3 = azf3 AND

bzf2 = azf2

WHERE a~f1 = p_f1

AND a~f2 = p_f2.

Iam getting 3 record i.e 3 a b 8

and if increase the records in z2 its gives me someother record its picking a random record . I thought that it would bring the first record

Let me know

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
357

Hi Venki,

Can you please give us more details like how your z1 and z2 tables look like and what is the result you expect out of your inner join?

Thanks

Sanjeev

2 REPLIES 2
Read only

Former Member
0 Likes
357

Hi ,

ANY SUUGESTIONS

Thanks

Read only

Former Member
0 Likes
358

Hi Venki,

Can you please give us more details like how your z1 and z2 tables look like and what is the result you expect out of your inner join?

Thanks

Sanjeev