Application Development 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: 

what if we have only two key fileds out of three.

Former Member
0 Kudos

hi

if my table has 3 key fields,

i need to get a value which is not a key field

if i have only two keyvalues,

ie. key1

key2

but i dont have key3.

if i put a select query with only two key fields, would it still be fetching unique records.

1 ACCEPTED SOLUTION

former_member583013
Active Contributor
0 Kudos

if my table has 3 key fields,
i need to get a value which is not a key field

No problem...If you got the key fields, you can gather any field which is not key itself...


if i have only two keyvalues,
ie. key1
key2

but i dont have key3.

Should be ok, but you could get some performance issues...


if i put a select query with only two key fields, would it still be fetching unique records.

Of course...In the DB you got 3 key fields...So If you select using just 2 of them your going to get the data but it's going to take longer and of course, you're going to get more data...Because the third it's not being used...

Greetings,

Blag.

3 REPLIES 3

0 Kudos

All the three fields combine to give a unique record. So according to your criteria there is a possibility to fetch multiple records from the table.

regards

Saravanan

former_member583013
Active Contributor
0 Kudos

if my table has 3 key fields,
i need to get a value which is not a key field

No problem...If you got the key fields, you can gather any field which is not key itself...


if i have only two keyvalues,
ie. key1
key2

but i dont have key3.

Should be ok, but you could get some performance issues...


if i put a select query with only two key fields, would it still be fetching unique records.

Of course...In the DB you got 3 key fields...So If you select using just 2 of them your going to get the data but it's going to take longer and of course, you're going to get more data...Because the third it's not being used...

Greetings,

Blag.

Former Member
0 Kudos

Hello Sanjana,

I had updated my logic in your thread. We can't do this . In told you that logic as I found only one entry for AENNR in my system

Thanks,

Greetson