Hi I am little new for the oracle sql queries. I have a table having the owners information of a particular product. There are as many 6 owners for a production. The table structure is like:
product | product id | owner1 | owner2 | owner3 | owner4 | owner5 | owner6 | producttype |
---|
A | 1 | ab123 | ab124 | ab125 | bn657 | ht567 | kj768 | electronic |
| | | | | | | | |
I want to pass the ownerid and to see the list of the product where he is owner.
I am using the below query:
select count(1) as HAVEACCESS from catalogwhere (lower(OWNER1) = 'owner' or lower(OWNER2) = 'owner'
or lower(OWNER3) = 'owner' or lower(OWNER4) = 'owner' or lower(OWNER5) = 'owner' or lower(OWNER6) = 'owner' and producttype = 'electronic'
As there are 5 OR condition in the sql query which may impact the performance. Can some one please suggest the better query.