posted 17 years ago
Hi,
I have 2 tables in my database Tier and Aff
(Aff_id is PK of Aff and FK of Tier)
I am not sure why the following query is returning 3 records when it should return one.
SQL> select tier.TIER_ID
2 FROM tier , aff
3 where tier.AFF_ID =(select AFF_ID from aff where AFF_ABBR_TXT='AAA')
4 AND (MIN_DPST_AMT <= 501)
5 and (MAX_DPST_AMT>= 501);
TIER_ID
----------
309
309
309
MIN_DPST_AMT, MAX_DPST_AMT are columns in TIER table.
Also I must tell you tier table has only one record with Tier ID 309 .
What is wrong in the query?
Thanks,
Ameer