In my DB. I have three tables Category, Location and classification.
I have some value in array for every column
location:['delhi','mumbai','goa','chennai']
Category:['Teacher','Student','Managment']
classification:['expert','normal']
Now I want to fetch the combination of data from the table.
I'm using a stored procedure for this.
Previously I have only one location, one category and one classification so I'm using this:
FROM user u1, serviceprovider s1, city c1
WHERE s1.userId = u1.id
AND c1.cityId = s1.city
AND s1.serviceProviderId IN
(SELECT DISTINCT serviceprovidecategoryr_cl AS serviceProviderId
FROM Db.serviceprovider_cl__serviceproviderclassification_classification t1
INNER JOIN Db.location_servicelocation__serviceprovider_locationid t2 ON t1.serviceprovider_cl = t2.serviceprovider_locationId
INNER JOIN Db.category_serviceprovidercategory__serviceprovider_category t3 ON t2.serviceprovider_locationId = t3.serviceprovider_category
WHERE
t1.serviceproviderclassification_classification IN
(SELECT serviceProviderClassificationId
FROM serviceProviderClassification sp
WHERE sp.name = classification)
AND t2.location_serviceLocation IN
(SELECT locationId
FROM location
WHERE shortAddress = location)
AND t3.category_serviceProviderCategory IN
(SELECT categoryId
FROM category
WHERE categoryName = category)
);
END
but now I'm getting the multiple values so how to modify this stored procedure?
If there is any other good way for doing this.
Please help...