How to improve the following query
Any suggestions on how to improve the following query.
- avalableInd is a boolean, has a value of 1 or 0.
- I am looking for only one shoeId with certain shoetype and availableInd=1.
select shoeId from (select shoeId from shoeGroup where shoeId in
(select shoeId from shoe where shoeType=:"SYS_B_0" and availableInd=:"SYS_B_1") and availableInd=:"SYS_B_2")
where ROWNUM=:"SYS_B_3"
SQL> desc Shoe;
Name Null? Type
----------------------------------------- -------- ----------------------------
SHOEID NOT NULL VARCHAR2(100) : primary key
SHOETYPE VARCHAR2(25)
avalableInd NUMBER(10)
QL> desc ShoeGroup;
Name Null? Type
----------------------------------------- -------- ----------------------------
SHOEID NOT NULL VARCHAR2(100) : primary key
ALTTYPE VARCHAR2(25)
avalableInd NUMBER(10)
Thanks,