2
I am doing an INNER JOIN of the Combo Table with the Product Combo Table as shown below...
SELECT C.SchoolID, C.ComboID, P.Active, P.Name, P.ProductID
FROM sales.Combo AS C
INNER JOIN commons.Stock AS S ON C.SchoolID = S.SchoolID AND C.ProductID = S.ProductID
INNER JOIN commons.Product AS P ON C.SchoolID = P.SchoolID AND C.ProductID = P.ProductID
WHERE (C.SchoolID = 01)
It returns me for example the following values:
SchoolID___|ComboID___|Active___|Produto
01_________|01________|True______|01
01_________|01________|False_____|02
01_________|02________|True______|01
01_________|02________|True______|05
I am trying to modify this my Query so that if 1 of the Combo products is as Active = False it does not select the Comboid that has this product = false
I tried using IF but was unsuccessful...
You could not add in "AND Active IS TRUE" ?
– Lucas Henrique
If I add "AND Active IS TRUE" it will continue selecting the Combo because the other Combo product is like "TRUE".
– Jhonas